简体   繁体   中英

NoClassDefFoundError when running app on Samsung device but not when running on an emulator

When I test my app on an emulator, (Nexus One API 21) it runs smoothly without fail. However, when I test the app on my own personal phone(Samsung Galaxy S5,Android version 5.0,also API 21), it crashed with a NoClassDefFoundError. This error occurs at a part of the code where I am using an external library from a jar file.(jaudiotagger) Could it be that my own android phone does not have the jdk to support the library? How do I resolve that?

  • First go to "Properties" of the project.
  • then select "Java Build Path"
  • after that select "Order and Export" Tab
  • You should see the selected project's "src" and "gen" paths and dependencies here.
  • The order how they listed were first "src" and then "gen" path
  • Switch them, so that "gen" folder is build before the "src"

try it but I am not sure whether it will help you :/ In my case worked

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM