I have a rather big Android App project that is referencing several library projects. Everything was fine until i upgraded the eclipse ADT plugin to the newest version (v22). I also upgraded the SDK of course. I do not see any compile errors in eclipse, but when i run the project on the phone i get a NoClassDefFoundError.
java.lang.NoClassDefFoundError: org.acra.ACRA
....
The arca library is included in one of the referenced library project (in the libs folder) and i can see it in the "Android Private Libraries" in the package explorer, also as i said, no compile errors. The project runs fine on everyone else's computer that did not upgrade ADT.
I have already tried a whole bunch of stuff including but not limited to:
- re-install the android SDK
- download a fresh ADT bundle
- delete all my code an get it again from git
- copy the library in question to the app project
- comment out the code that uses this library - i just get the same error for the next library
all without any success, so i'm getting really desperate here.
I would be really happy if anyone could give me a hint on how to solve that problem.
I had also the same problem,
i) add gson lib as referecend librairies
ii) check it in java Build Path
Quoting Streets of Boston from his adt-dev post:
Give this a shot and with luck it will solve your problem.
I had also the same problem and my
adt
was22.0.1
. And none of the solution above worked. Further when adding a external library project to a working project.I always check thegen
folder of working project and ifR
of external library project is there (along with package name),then only external library project is exported. And on mygen
folder nopackagename
of external library was shown.So I checked on
project.properties
file and there wasn't any external library link presentandroid.library.reference.1=
present. So I manually added the external library reference there ,even though I had added fromproject->properties->Java Build Path->Projects->Add
. So manually editing theproject.properties
did all the work for me.I had the same problem. It was because of the eclipse project. To solve it I created a new project in eclipse, copy my existing project classes and resources into it and then launched eclipse again and added my custom includes.
I have encountered a similar problem, spent about 3 hours, but none of the proposed here decisions did not help... Finally I found a source of the problem: my project files & project.properties were read-only. Eclipse is simply silently ignoring any changes in library dependencies when I doing it in the GUI!
Simply checking Android Private Libraries was not enough, I also had to install Android SDK Build-tools in Android SDK Manager.