ADT 22 ClassNotFoundException fix...

They did it again, they broke my project with another ADT update.  This happened once back with ADT 17 where I had to change the "lib" folder to "libs", and today with the update to ADT 22 I found myself in a similar situation.  I started getting ClassNotFoundException when trying to launch my app as soon as I updated ADT.  With some digging I noticed that the DEX file in the APK was about 1/3 the size it should be, so it seemed true that the classes were indeed missing.  The strange thing was that some classes seemed to work just fine.  Mind you, the project I'm working with is extremely complicated and uses multiple layers of library projects and many included libraries, so maybe that had something to do with it.  Testing old simple projects had no issue.

Eventually I really started making progress with this when I made a new project and copied all my files and resources into it.  The ClassNotFoundException magically disappeared and things worked correctly.  When I investigated further I spotted that the Android Private Libraries are now exported when building, and the Android Dependencies aren't.  I went back to the original project, replicated this, and the ClassNotFoundException was fixed!  This is all stated much more quickly than it took me to figure this out, so hopefully I can save other developers time by describing the fix.

Steps to fix:
1) Open the project properties in Eclipse (Alt+Enter)
2) Select "Java Build Path"
3) Select the "Order and Export" tab
4) Ensure that ONLY "Android Private Libraries" is checked
5) Clean your project (for good measure) and build again
6) Run!!!
Shared publiclyView activity