java.lang.NoClassDefFoundError: how do I fix this error?

允我心安 提交于 2019-12-18 09:27:54

问题


I am developing an Android application which makes use of the Osmdroid maps api. I have added the library as an external jar in my build path and I do not get any errors during compile time. However, upon device deployment I get the following error:

03-27 16:18:50.986: E/AndroidRuntime(3306): java.lang.NoClassDefFoundError: org.osmdroid.util.GeoPoint

I have done some googgling and it is still a mystery to me.

Here is my IDE configuration.

Eclipse: Indigo Release version 2  
Java SDK: 1.6.0_31  
Android SDK: 17

回答1:


You need to go into Build Path/Order and Export, and check the libs as of SDK 17. Then clean your project.




回答2:


I doubt about you and your project. From my viewpoint, I see you have a good design. But why are you working with Build Path / Order and Export? Honestly I've never gone to that tab from the first day I worked with Eclipse.

To import jar files as libraries, use tab Libraries -> add external Jars.

And I'm sorry I don't know about game programming, this is just a suggestion: make sure your engine fits what Android supports. For example Android doesn't support javax.imageio. If not, the app can be compiled with external jars, but can be crashed in runtime.



来源:https://stackoverflow.com/questions/9897254/java-lang-noclassdeffounderror-how-do-i-fix-this-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!