Android 应用程序无法启动 noClassDefFoundError

标签 android error-handling android-emulator logcat acra

我正在为 android 创建一个 gps 应用程序!现在我偶然发现了一个问题。该应用程序根本无法启动...关于如何解决此问题的任何想法?

04-05 12:54:50.877: D/dalvikvm(540): Not late-enabling CheckJNI (already on)
04-05 12:54:51.018: I/dalvikvm(540): Turning on JNI app bug workarounds for target SDK version 5...
04-05 12:54:51.417: I/dalvikvm(540): Could not find method org.acra.ACRA.init, referenced from method com.kulplex.gaia.GaiaApp.onCreate
04-05 12:54:51.417: W/dalvikvm(540): VFY: unable to resolve static method 652: Lorg/acra/ACRA;.init (Landroid/app/Application;)V
04-05 12:54:51.417: D/dalvikvm(540): VFY: replacing opcode 0x71 at 0x0000
04-05 12:54:51.457: D/AndroidRuntime(540): Shutting down VM
04-05 12:54:51.457: W/dalvikvm(540): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
04-05 12:54:51.477: E/AndroidRuntime(540): FATAL EXCEPTION: main
04-05 12:54:51.477: E/AndroidRuntime(540): java.lang.NoClassDefFoundError: org.acra.ACRA
04-05 12:54:51.477: E/AndroidRuntime(540):  at com.kulplex.gaia.GaiaApp.onCreate(GaiaApp.java:54)
04-05 12:54:51.477: E/AndroidRuntime(540):  at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
04-05 12:54:51.477: E/AndroidRuntime(540):  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3954)
04-05 12:54:51.477: E/AndroidRuntime(540):  at android.app.ActivityThread.access$1300(ActivityThread.java:123)
04-05 12:54:51.477: E/AndroidRuntime(540):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
04-05 12:54:51.477: E/AndroidRuntime(540):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-05 12:54:51.477: E/AndroidRuntime(540):  at android.os.Looper.loop(Looper.java:137)
04-05 12:54:51.477: E/AndroidRuntime(540):  at android.app.ActivityThread.main(ActivityThread.java:4424)
04-05 12:54:51.477: E/AndroidRuntime(540):  at java.lang.reflect.Method.invokeNative(Native Method)
04-05 12:54:51.477: E/AndroidRuntime(540):  at java.lang.reflect.Method.invoke(Method.java:511)
04-05 12:54:51.477: E/AndroidRuntime(540):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-05 12:54:51.477: E/AndroidRuntime(540):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-05 12:54:51.477: E/AndroidRuntime(540):  at dalvik.system.NativeStart.main(Native Method)

最佳答案

更新到最新的 Android 工具后,我遇到了同样的问题。

在项目属性、Java Build Path、Order 和 Export 部分,我必须确保选中了 Android Private Libraries。

然后我不得不清理项目。之后它似乎工作了。

It was indeed an issue with 'Order and Export' of the Java Build Path.

When upgrading, the 'Order and Export' of the new 'Android Private Libraries' is not always checked. And the android-support-v4.jar is now in this 'Android Private Libraries' section.

To fix this, go to 'Order and Export' and check 'Android Private Libraries'. Then refresh/clean/rebuild.

After you done this 'fix' for a library project, you may need to just close and re-open any depending project, because they may not see this 'fix' immediately.

我找到了答案 here .

关于Android 应用程序无法启动 noClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10015203/

相关文章:

android - 为什么部分文本位于屏幕后面?

android - HockeyApp 崩溃分析 - App Store 和 Play Store

android - 为什么某些设备不支持我们的 Android 应用程序

c# - TypeLoadException 隐藏内部异常

perl - 如何从Perl处理程序更改Apache ErrorDocument?

django - Django中的错误响应

android - 设备 android 模拟器上没有剩余空间;即使删除数据后

android - 在真实设备上运行 Android 应用程序时要输入哪个 IP 地址?

android - 从 vagrant 机器连接到 android 模拟器

android - 我为免费和高级应用程序使用哪些软件包?