NoClassDefFoundError Exception Android应用程序

时间:2014-05-07 03:20:48

标签: java android eclipse

我一直在尝试在我的Android应用程序中使用Sendgrid。这是我正和另外3个人合作的项目。该应用程序在他们的手机和模拟器上工作得很好,但它似乎总是在我的模拟器和手机上崩溃并显示此错误信息

05-07 03:15:12.940: W/EGL_emulation(1336): eglSurfaceAttrib not implemented
05-07 03:15:13.510: D/onDestroy(1336): 2014-05-07 03:15:11
05-07 03:15:13.700: D/dalvikvm(1336): GC_CONCURRENT freed 338K, 33% free 3276K/4820K, paused 5ms+4ms, total 65ms
05-07 03:15:13.790: E/dalvikvm(1336): Could not find class 'com.github.sendgrid.SendGrid', referenced from method edu.upenn.capsproject.SurveyActivity$SendEmailWithSendGrid.doInBackground
05-07 03:15:13.790: W/dalvikvm(1336): VFY: unable to resolve new-instance 744 (Lcom/github/sendgrid/SendGrid;) in Ledu/upenn/capsproject/SurveyActivity$SendEmailWithSendGrid;
05-07 03:15:13.790: D/dalvikvm(1336): VFY: replacing opcode 0x22 at 0x0001
05-07 03:15:13.790: D/dalvikvm(1336): DexOpt: unable to opt direct call 0x1505 at 0x07 in Ledu/upenn/capsproject/SurveyActivity$SendEmailWithSendGrid;.doInBackground
05-07 03:15:13.800: W/dalvikvm(1336): threadid=11: thread exiting with uncaught exception (group=0x40a71930)
05-07 03:15:13.810: E/AndroidRuntime(1336): FATAL EXCEPTION: AsyncTask #1
05-07 03:15:13.810: E/AndroidRuntime(1336): java.lang.RuntimeException: An error occured while executing doInBackground()
05-07 03:15:13.810: E/AndroidRuntime(1336):     at android.os.AsyncTask$3.done(AsyncTask.java:299)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.FutureTask.run(FutureTask.java:239)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.lang.Thread.run(Thread.java:856)
05-07 03:15:13.810: E/AndroidRuntime(1336): Caused by: java.lang.NoClassDefFoundError: com.github.sendgrid.SendGrid
05-07 03:15:13.810: E/AndroidRuntime(1336):     at edu.upenn.capsproject.SurveyActivity$SendEmailWithSendGrid.doInBackground(SurveyActivity.java:368)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at edu.upenn.capsproject.SurveyActivity$SendEmailWithSendGrid.doInBackground(SurveyActivity.java:1)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
05-07 03:15:13.810: E/AndroidRuntime(1336):     ... 4 more
05-07 03:15:15.219: W/EGL_emulation(1336): eglSurfaceAttrib not implemented
05-07 03:15:16.289: I/Process(1336): Sending signal. PID: 1336 SIG: 9
05-07 03:15:16.750: E/Trace(1362): error opening trace file: No such file or directory (2)

我在引用的库路径中有sendgrid-0.2.0-jar.jar.zip文件。

1 个答案:

答案 0 :(得分:0)

转到项目/属性/ Java构建路径/订单和导出 - 如果您使用它,请确保在Android Dependencies和支持库前面进行检查。选中所有复选框,然后单击“应用”并清除项目。

this帖子

上的答案复制而来

希望这有帮助。