I get these errors:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/stream/JsonReader;
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.gson.stream.JsonReader" on path: DexPathList[[zip file "/data/app/project.1stApp.youtubeplayer-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
When I'm trying to run my application, this 'com.google.gson' library is a jar file that I did added to my project and can't understand when I have this problems..
No code added as I find it not relevent to the error...
Copy jar into your libs folder and add this to your build.gradle dependencies
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.3.1'
(Exchange 2.3.1 for your version of json, or use 2.3.*)
Dont forget to sync
I use AS.I meet the same problem when I generated signed apk and I do add gson.jar as library.Then i clean the project the problem gone;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With