gpt4 book ai didi

java - Android 应用程序出现 NoClassDefFoundError 异常

转载 作者:太空宇宙 更新时间:2023-11-04 14:53:21 26 4
gpt4 key购买 nike

我一直在尝试在我的 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 文件。

最佳答案

转到项目/属性/Java 构建路径/顺序和导出 - 确保 Android 依赖项和支持库前面有一个检查(如果您使用它)。标记所有复选框并单击“应用”并清理项目。

复制 self 对 this 的回答发布

希望这有帮助。

关于java - Android 应用程序出现 NoClassDefFoundError 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23508146/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com