Libraries do not get added to APK anymore after upgrade to ADT 22

SimonSays picture SimonSays · May 16, 2013 · Viewed 70.8k times · Source

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.

Answer

CommonsWare picture CommonsWare · May 16, 2013

Quoting Streets of Boston from his adt-dev post:

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.

Give this a shot and with luck it will solve your problem.

enter image description here