java.lang.NoClassDefFoundError: com.google.gson.Gson

今天在解析json文件的时候出现的问题,在做单元测试时调用Gson毫无问题,但在系统测试时出现,bing了一下在stackoverflow上找到答案,是在android编译时没有把jar包添加到库中的原因:

1.Down load the latest version of gason.jar
2.Add the jar of gason to the project[Eclipse: project proprieties => Java Build Path => Libraries =>Add External JARs]
3.check the gason.jar in Order and Export
java.lang.NoClassDefFoundError: com.google.gson.Gson_第1张图片

点我查看源地址

你可能感兴趣的:(Java,android)