Home > Java > javaTutorial > How to Fix 'NoClassDefFoundError' in Eclipse Android Development After Adding External Libraries?

How to Fix 'NoClassDefFoundError' in Eclipse Android Development After Adding External Libraries?

Mary-Kate Olsen
Release: 2024-12-05 04:49:10
Original
466 people have browsed it

How to Fix

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template