stefanmedack / moshikotlinexample Goto Github PK
View Code? Open in Web Editor NEWExample project on how to leverage Kotlin for better JSON parsing
License: Apache License 2.0
Example project on how to leverage Kotlin for better JSON parsing
License: Apache License 2.0
When I run app.kt
, I got this error:
Exception in thread "main" java.lang.RuntimeException: Failed to find the generated JsonAdapter class for class de.stefanmedack.model.Article
at com.squareup.moshi.internal.Util.generatedAdapter(Util.java:481)
at com.squareup.moshi.StandardJsonAdapters$1.create(StandardJsonAdapters.java:60)
at com.squareup.moshi.Moshi.nextAdapter(Moshi.java:168)
at de.stefanmedack.adapter.DefaultOnDataMismatchAdapter$Companion$newFactory$1.create(DefaultOnDataMismatchAdapter.kt:35)
at com.squareup.moshi.Moshi.adapter(Moshi.java:137)
at com.squareup.moshi.Moshi.adapter(Moshi.java:97)
at com.squareup.moshi.Moshi.adapter(Moshi.java:71)
at de.stefanmedack.AppKt.printArticle(app.kt:11)
at de.stefanmedack.AppKt.main(app.kt:7)
Caused by: java.lang.ClassNotFoundException: de.stefanmedack.model.ArticleJsonAdapter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.squareup.moshi.internal.Util.generatedAdapter(Util.java:467)
... 8 more
I have got very similar error with my own sample project when I tried moshi code gen with IntelliJ, it was fine with Android Studio though.
(I'm using IntelliJ 2018.3.3)
Do you have any idea why is this happening?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.