39

Some time ago I developed a rather simple app, with a target of 4.2.2. I had it working normally in my device. Then I stopped development for about 1 month.

After the recent Google I/O, I decided to come back to development. What I first did was open the Android SDK Manager and update to the newly available packages (I think it was only the SDK tools, platform tools, and not much more).

I then tried to run the project and got this java.lang.ClassNotFoundException. I checked everything, no errors at all, building completing successfully.

java.lang.ClassNotFoundException: Didn't find class "com.example.compassgps.CompassGPSActivity" on path: /data/app/com.example.compassgps-2.apk

I have tried a lot of things: cleaned the project, changed Android target (in case the new revisions to API17 had made anything crash)...

I have searched through StackOverflow's already asked questions, but have not found any of the situations in which the changes to the project were NONE. So I am feeling quite frustrated now because I have actually changed NOTHING and my project has stopped working :(

Neil Townsend
  • 6,024
  • 5
  • 35
  • 52
Jago
  • 2,751
  • 4
  • 27
  • 41

1 Answers1

110

Right click on your project goto properties. Java Build Path. Choose Order export tab. Make sure that Android Private Libraries is selected. If you have referenced library project. do the same for the library project also. Clean and Build.

Also goto android sdk manager and check that you have the android sdk build tools installed. This many not be necessary but make sure you have android build tools installed.

Raghunandan
  • 132,755
  • 26
  • 225
  • 256
  • 1
    did it work after doing as suggested in the answer or just clean and build worked? – Raghunandan May 19 '13 at 15:11
  • after doing what you suggesting. @Jago Please mark this answser as accepted, – Blackbelt May 19 '13 at 15:15
  • It worked after doing what you suggested and then clean&build. I had tried before many times to clean&build before but it didn't work until I marked that Android Private Libraries option you suggested. – Jago May 19 '13 at 15:15
  • @blackbelt I have had to wait for 5 ridiculous minutes before stackoverflow allowed me to mark as accepted... i would have happily done much before..! – Jago May 19 '13 at 15:16
  • 4
    Then close as duplicate – Blackbelt May 19 '13 at 15:18
  • THUMBS UP FOR THIS ANSWER! YOU JUST SAVED MY LIFE! – Otuyh May 31 '13 at 15:50