Just updated my SDK and ADT to 17 and my project builds without problem but every time I try to execute it on a phone I get a java.lang.NoClassDefFoundError.
The not-found classes are in a jar lib in the project (in my case the ACRA lib). The jar is in the Referenced Libraries section of the project. So should work.
And I try on a different eclipse installation with ADT and SDK 16 and it works flawlessly.
Any idea why it doesn't with ADT / SDK 17 ? (Maybe due to the change of the library projects)
For info, I try to launch another project without jar lib : it works.
Same for another project with an Android Library projects added to it but without jar lib : works too
Didn't try with only a jar lib and no Android Library projects but I can do the test if needed
(Other info : i'm on Eclipse 3.7.1 on MacOSX)
3 plus ones
Shared publicly•View activity
- Please read this (linked from the blog post and soon from the release notes): http://tools.android.com/recent/dealingwithdependenciesinandroidprojectsMar 21, 2012
- The error was that the libs were stored in a "lib" folder instead of "libs" and were added manually through the java build path.
I remove them from the java build path and rename the folder to libs. Now they are shown in Android Dependencies and it works !!
Thanks !!Mar 21, 2012
- I'm having the same problem, but in my case the class not found is within the same package, in trying to go from one activity to another using startActivity(new Intent(this, MainActivity.class) from SplashActivity (all within the same package). Any ideas?
I found a solution.
I needed to manually add the .jars for each library/project to a libs folder and from there add them to the buildpath. If using the "normal" way by using "add library" from android properties and adding external jars from the build-path they would not end up in the libs folder etc and then it would crash.....Mar 22, 2012
- The guys from DroidUX found another solution to do it. I don't know if you can use this solution but I've added their solution to my blog post about this issue :
http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17 (At the end of the post)Mar 22, 2012
- I'm just very surprised so many people used "lib" when we've mostly always talked about using "libs" (which is what Ant use for automatic dependencies). We'll improve things for r18.Mar 22, 2012
- "src", "res" both without 's' so I used "lib" without 's' too
Not a big deal as soon as you found the reason ^^Mar 22, 2012
- My issue seems to be a little different. It says that the Android Dependencies container references non-existing library, which it says is annotations.jar. Sure enough, the update seems to have completely deleted it from my system. Should I just search out the new jar and put it in the same location?Mar 22, 2012
Add a comment...