在我 java.lang.NoClassDefFoundError
的 java 项目中使用 android.jar 和 gson jar 时出现错误。我在下面的行中收到错误
Type typeOfReultClass = new TypeToken<URLDataResponse>() {}.getType();
在logcat错误之下:
E/AndroidRuntime(26480): FATAL EXCEPTION: main
E/AndroidRuntime(26480): java.lang.NoClassDefFoundError: com.kony.andffiJS.DownloadActivity$3
E/AndroidRuntime(26480): at com.kony.andffiJS.DownloadActivity.downloadData(DownloadActivity.java:92)
E/AndroidRuntime(26480): at com.kony.andffiJS.DownloadActivity.access$2(DownloadActivity.java:86)
E/AndroidRuntime(26480): at com.kony.andffiJS.DownloadActivity$1.onClick(DownloadActivity.java:60)
E/AndroidRuntime(26480): at android.view.View.performClick(View.java:4203)
E/AndroidRuntime(26480): at android.view.View$PerformClick.run(View.java:17189)
E/AndroidRuntime(26480): at android.os.Handler.handleCallback(Handler.java:615)
E/AndroidRuntime(26480): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(26480): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(26480): at android.app.ActivityThread.main(ActivityThread.java:4950)
E/AndroidRuntime(26480): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(26480): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(26480): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
E/AndroidRuntime(26480): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
E/AndroidRuntime(26480): at dalvik.system.NativeStart.main(Native Method)