Why can't android find com.google.gson.Gson

后端 未结 12 2011
[愿得一人]
[愿得一人] 2021-02-03 23:12

I\'m trying to use GSON in my project, but my application is crashing, with logcat saying that com.google.gson.Gson cannot be found. I\'ve put import com.google.gson.Gson on my

12条回答
  •  既然无缘
    2021-02-03 23:55

    What worked for me: Check the checkbox next to the lib (gson-2.0.jar) in: 'Project Properties' -> 'Java Build Path' -> 'Order and Export' tab. Then do a clean/build.

    This adds the exported=true attribute to the classpath entry

    
    

提交回复
热议问题