Gson class not found when running android app

☆樱花仙子☆ 提交于 2019-12-12 05:24:51

问题


I have some problems about Gson import in my project

if I dependency like this:

compile 'com.google.code.gson:gson:2.8.1'

The compile is OK,but when I run my app, it has bean crashed,such as enter image description here

I try to dump the apk and analyze it, I found there is Gson in the dex,but runtime crash.

but when I download the gson.jar and put it into libs then make the dependency like this:

compile fileTree(dir: 'libs', include: ['*.jar'])

it fully worked.

and I don't know why ? so help me.

sincerely!!!

来源:https://stackoverflow.com/questions/44851150/gson-class-not-found-when-running-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!