Home >Java >javaTutorial >How to Fix 'NoClassDefFoundError' in Eclipse Android Development After Adding External Libraries?
Resolving NoClassDefFoundError in Eclipse Android Development
When attempting to run an Android application after integrating an external library, developers occasionally encounter a "NoClassDefFoundError." This exception points to a missing class despite its presence in the JAR file. To address this issue, consider the following solution:
Renaming Library Folder
After updating Android Development Tools (ADT), it has been observed that Eclipse searches for library JAR files in a folder named "libs." Previously, storing JARs in a "lib" folder and adding them manually to the build path worked.
To resolve the NoClassDefFoundError, remove the JARs from the build path and rename the "lib" folder to "libs." This convention aligns with Ant, allowing ADT's latest version to detect and include libraries in the generated APK file.
The above is the detailed content of How to Fix 'NoClassDefFoundError' in Eclipse Android Development After Adding External Libraries?. For more information, please follow other related articles on the PHP Chinese website!