I\'m having a problem trying to run an Android app which, up until adding a second external library to its build path, was working fine. Since having added the scoreninja ja
I had this problem and it was caused by not "exporting" the library.Issue was just because the .class files for some classes are not available while packaging the APK.Compile time it will work fine with out exporiting
In my case I was using "CusrsorAdapter" class and under "JavaBuildPath->Order and Export" I didn't check the support V4 jar.Once it is selected issue is gone.
To make sure you are getting noClassDefFound error because of above reason, please check your logacat, you will see unknown super classs error at run time.
All the existing answers don't work for me because my case is a little bit different. It took me a few hours to get it to work. I'm using Eclipse.
My android project includes another normal java 1.6 project, which needs a 3rd party jar file. The trick is:
Hope this help those who have similar scenarios like mine.
By adding the external jar into your build path just adds the jar to your package, but it will not be available during runtime.
In order for the jar to be available at runtime, you need to:
assets
folder This happens quite very often to me.
Last time that happened I can remembered was caused by switching the Eclipse ADT (Google special edition) to Android Studio, and switching back. I basically tried all methods that I can found on stackoverflow which didn't work for me.
Eventually, I got the app working again (no more NoCalssDeffoundError) by switching my IDE to original Eclipse (Kepler) with ADT.
I didn't have to put the jar-library in assets or lib(s), but only tick the box for this jar in Properties -> Java Build Path -> "Order and Export" (it was listed before, but not selected)
I have changed the order of included projects (Eclipse / Configure Build Path / Order and Export). I have moved my two dependent projects to the top of the "Order and Export" list. It solved the problem "NoClassDefFoundError".
It is strange for me. I didn't heard about the importance of the order of included libraries and projects. Android + Eclipse is fun :)