NoClassDefFoundError - Eclipse and Android

后端 未结 27 964
夕颜
夕颜 2020-11-22 08:02

I\'m having a problem trying to run an Android app which, up until adding a second external library to its build path, was working fine. Since having added the scoreninja ja

相关标签:
27条回答
  • 2020-11-22 08:39

    I tried various things and the reason for error in my case was conflict between maps.jar and Google Api in Java Build Path-> Libraries. So, when i removed the maps.jar it worked fine.

    Regards,

    wahib

    0 讨论(0)
  • 2020-11-22 08:39

    The solution here worked for me. It's a matter of importing the library to the libs folder, then modifying the build.gradle file and then cleaning with gradlew.

    0 讨论(0)
  • 2020-11-22 08:41

    I had this problem after updating ADT.

    I was storing all of my JAR files in a folder called "lib" and adding the jars to the build path the normal Eclipse way. This worked fine until my update.

    After my update, I was getting the NoClassDefFoundError for a class that I could clearly see was included in the jar (checking out the ReferencedLibraries classes).

    The solution was to remove my jars from the build path and rename my "lib" folder to "libs". This is an ant convention, and seems to be the way the new ADT finds and includes libraries in an .apk file. Once I did this, everything worked fine.

    0 讨论(0)
  • 2020-11-22 08:41

    Try this:-

    Step 1

    Add all the libraries to build pat in Eclipse( means make all libraries referenced libraries)

    Step 2

    Delete R.java file and again build the project. Don't worry, R.java will automatically get recreated.

    Chill :)

    0 讨论(0)
  • 2020-11-22 08:42

    I had this same error with ADT22. Resolved it checking "Android Private Libraries" in properties -> Java build path -> Order and export. If you are using any library projects, the same should be done for them as well.

    0 讨论(0)
  • 2020-11-22 08:43

    sometimes you have to take the whole external project as library and not only the jar:

    my problem solved by adding the whole project (in my case google-play-services_lib) as library and not only the jar. the steps to to it (from @style answer):

    1. File->New->Other
    2. Select Android Project
    3. Select "Create Project from existing source"
    4. Click "Browse..." button and navigate to the wanted project
    5. Finish (Now action bar project in your workspace)
    6. Right-click on your project -> Properties
    7. In Android->Library section click Add
    8. select recently added project -> Ok
    0 讨论(0)
提交回复
热议问题