2

I have been working on a project for the past few months with some colleagues, and as we finished our final android build some of us started to get the noclassdeffrounderror in our LogCat when we would run the app on our devices. The code did not change, and the class it is referencing the call from is on the same level, in the same package as the class that cannot be found. The project runs on other computers, and seems kind of random. I have tried everything to resolve this, but none have worked. If I compile the code on a different computer that can, and make an apk, it runs fine. But if compiled from a computer that has the error, it will always crash. Help!

04-17 20:05:55.929: E/AndroidRuntime(12615): FATAL EXCEPTION: main
04-17 20:05:55.929: E/AndroidRuntime(12615): java.lang.NoClassDefFoundError: com.team.catswithhats.AndroidGPS
04-17 20:05:55.929: E/AndroidRuntime(12615):    at com.team.catswithhats.MainActivity.onCreate(MainActivity.java:14)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at android.app.Activity.performCreate(Activity.java:5104)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at android.os.Looper.loop(Looper.java:137)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at android.app.ActivityThread.main(ActivityThread.java:5041)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at java.lang.reflect.Method.invokeNative(Native Method)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at java.lang.reflect.Method.invoke(Method.java:511)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-17 20:05:55.929: E/AndroidRuntime(12615):    at dalvik.system.NativeStart.main(Native Method)
Trung Nguyen
  • 7,442
  • 2
  • 45
  • 87
Charles Lillo
  • 355
  • 3
  • 16
  • 1
    Are you using proguard? – LuxuryMode Apr 18 '13 at 00:17
  • The proguard.cfg file is in there, but not in project properties. Removing it did not resolve the issue. – Charles Lillo Apr 18 '13 at 00:20
  • On that other machine, is the package that contains this class file marked as a source folder? – LuxuryMode Apr 18 '13 at 00:27
  • Could it be that the different computers run different versions of ADT? Because some of them seem to have that issue. See e.g. here http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17 or here http://stackoverflow.com/questions/10059152/java-lang-noclassdeffounderror-adt-17-known-issue – Emanuel Moecklin Apr 18 '13 at 00:30
  • @LuxuryMode the project is identical from computer to computer, it does not look as so. And one computer runs ADT, and the other (that does not run) runs Juno w/ the plugin. I believe they are both on the latest though. Its never caused a problem before. – Charles Lillo Apr 18 '13 at 00:42
  • "A simple man believes anything, but a prudent man gives thought to his steps". It's worth checking the ADT version and check the first link. – Emanuel Moecklin Apr 18 '13 at 00:51
  • are you using support library? after updating adt for support library thre was a similar problem in my project .. if so then my solution may help you – stinepike Apr 18 '13 at 00:54
  • And you're running it on the same device? – LuxuryMode Apr 18 '13 at 02:30
  • It looks like the ADT problem: see http://www.badlogicgames.com/wordpress/?p=2362 for a solution. – R Hyde Apr 18 '13 at 07:14

1 Answers1

0

This happens when a class is found in eclipse thus building correctly, but not at runtime.

Right Click your Android Project -> Properties -> Java Build Path -> Order and Export and check the core project and all the jars.

Daahrien
  • 10,190
  • 6
  • 39
  • 71