java.lang.ClassNotFoundException after changing nothing in the project but upgrading eclipse android sdk [duplicate]

白昼怎懂夜的黑 提交于 2019-11-25 22:28:15

问题


This question already has an answer here:

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/16636039/java-lang-classnotfoundexception-after-changing-nothing-in-the-project-but-upgra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!