Android app won't start noClassDefFoundError
Asked Answered
A

2

9

I'm creating a gps app for the android! And now I've stumbled upon a problem. The app doesn't start at all... Any ideas of how to fix this?

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)
Acclaim answered 4/4, 2012 at 16:18 Comment(3)
you need to post code for us to narrow down what the problem could be.Utilitarian
you should post your code but for what I could see in your errors, you are using a mapview and threads, and as far as I know there are issues regarding threads and mapviews since it "seems" that mapviews should be handled in the main thread.Albertson
great posting your error log wont solve your issue. what about code?///Jurado
B
19

If you've recently updated to ADT 17 and above, they've changed the lib library handling.

so you need to rename your lib dir to libs, then right click your project > properties > Java build path > Libraries > select all the jars with error markings on them and click remove > click add JARs > select all jars from your new libs dir.

Hope this helps.

Banter answered 19/4, 2012 at 7:59 Comment(0)
P
22

I had this same issue after updating to the latest Android tools.

In the project properties, Java Build Path, Order and Export section, I had to make sure the Android Private Libraries was checked.

Then I had to clean the project. After that it seems to work.

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.

I found the answer here.

Pleasurable answered 16/5, 2013 at 18:18 Comment(2)
This was fooling me with ACRA 4.5 and the newest android sdk tools 22, build tools 17. Thank you very much for your help.Jodyjoe
Same here, after updating to SDK Tools 22 and Build Tools 17 I had to tick the checkbox for Android Private Libraries in the Order and Export tab.Shaw
B
19

If you've recently updated to ADT 17 and above, they've changed the lib library handling.

so you need to rename your lib dir to libs, then right click your project > properties > Java build path > Libraries > select all the jars with error markings on them and click remove > click add JARs > select all jars from your new libs dir.

Hope this helps.

Banter answered 19/4, 2012 at 7:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.