问题
I get some soure from net. and import on my workspace. When i run on emulator, its throws,
"05-28 17:30:47.895: E/AndroidRuntime(840): java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.developmentmill.laserlogic/com.developmentmill.laserlogic.StageActivity}:
java.lang.ClassNotFoundException: com.developmentmill.laserlogic.StageActivity in
loader dalvik.system.PathClassLoader[/data/app/com.developmentmill.laserlogic-2.apk]"
But when i run the same code on my friend machine, its running without any error.
My eclipse ADT Version is 17.0 my friend eclipse ADT version is 16.0
I copy the jar files from lib folder to libs foder. and change the java build path from lib to libs folder. and also i cleaned the project.
Again, i run the project, the same error has been throw.
What is the problem and how to correct it? y its occur on my machine only. Pls help me.
回答1:
I have also faced this problem.
so try this.
Right click on project -> goto properties -> Java buid path -> libraries -> remove all External Jars from here -> press OK
also remove all jars from libs folder
clean project -> restart eclipse.
Then again put all required jars in libs folder.
I have solved my problem by this
hope this will help you....
回答2:
First create libs folder in your project and then add all jar file or library file used in project in libs folder and now run your project.
It will definitely run.
回答3:
What worked for me was: I already had a libs folder in the same hierarchy as my src & res folders. The FlurryAgent.jar file was saved on my Desktop. I simply right clicked on the FlurryAgent file, copied it. Then I pasted the file into the libs folder in Eclipse. Eclipse automatically copied the FlurryAgent.jar file into the “Android Dependencies” folder also.
来源:https://stackoverflow.com/questions/10784443/class-not-found-exception-on-android