java.lang.NoClassDefFoundError on Android sdk and ADT 20 Windows 64

两盒软妹~` 提交于 2019-12-02 11:58:55

问题


Good morning ppl. I have what it looks like to be a commong problem in android, import jars from libraries. I'm trying to use a library to consume an in house api. I copied the jar into the libs folder on my android project and went to Properties -> Java Build Path -> Libraries and added the jar. Also, I checked the boxes within the jar name in the Order and Export tab. all I have is the

java.lang.NoClassDefFoundError exception.

I have read almost every post that points to the same answer. Put the jar on libs folder and make the steps listed above. Nothing worked. I'm running the ADT v 20, on the Indigo release on a Win 7 x64. I'm not very skilled on java or java architectures but this is driving me nuts. Anyone has a differente approach to this? I'm missing something?

Thanks in advance


回答1:


You need to simply drag the jar file into the libs folder and not manually add it. Try deleting the jar file from

Properties -> Java Build Path -> Libraries

clean and rebuild the project.

Explanation: The process of loading library has been automated and changed from ADT 16 onwards and it is not backward compatible with the older method. You were actually trying to use both the methods of adding library which was adding the library twice and breaking it.




回答2:


Go on the tab "Order and Export", inside "Properties->Java Build Path" and check the unchecked boxes. It worked here...



来源:https://stackoverflow.com/questions/13272796/java-lang-noclassdeffounderror-on-android-sdk-and-adt-20-windows-64

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