Recently found a problem, sometimes repeated to an Android project Add jar and remove jar, found that thecompilation can be passed, but run up when applied to the external jar object, will throw java.lang.NoClassDefFoundError exception. Cause the program to crash.
Look at the project properties and find that the Android dependencies is less than the normal item in Java build path:
Through the comparison with the project before the loss, the difference is found in the engineering root directory of the . Classpath file,<classpathentry exported= "true" kind= "con" path= " Com.android.ide.eclipse.adt.LIBRARIES "/> here the exported turned false, and changed this back to true, Then shut down and open the project and find it OK .
In addition, if you import a jar package is not placed in the \libs directory of the Engineering directory , there will also be a problem, please put the jar package into the \libs directory, or even though it can be compiled, but because the package did not The jar is packaged so that it causes the exception above. Eclipse will automatically package the files in the \libs directory at compile time .
This question has not been seen before, and I don't know if it has anything to do with the Eclipse version and the ADT version.