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 :(

6
  • did you update adt to 22? Commented May 19, 2013 at 15:01
  • 1
    goto propertied java build path order export tab. make sure u choose Android Private libraries and click ok. Also goto android sdk manager. see if you have android sdk build tools installed. Commented May 19, 2013 at 15:06
  • 1
    @Raghunandan put your comment as an answer Commented May 19, 2013 at 15:07
  • @blackbelt You mean the Android SDK Tools Rev 22? Yes, exactly. Is there any known bug in such revision? Commented May 19, 2013 at 15:07
  • then follow the @Raghunandan instruction Commented May 19, 2013 at 15:07

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

6 Comments

did it work after doing as suggested in the answer or just clean and build worked?
after doing what you suggesting. @Jago Please mark this answser as accepted,
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.
@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..!
Then close as duplicate
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.