NoClassDefFoundError类存在,但是找不到

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/DennisRuan/article/details/51678882
NoClassDefFoundError类存在,但是找不到,引用jar包或者第三方项目时
如:引用nineoldandroid-2.4.0-2.jar时,出现以下情况:

06-15 01:01:23.472: E/AndroidRuntime(2218): java.lang.NoClassDefFoundError: com.nineoldandroids.animation.AnimatorSet
06-15 01:01:23.472: E/AndroidRuntime(2218): at com.gitonway.lee.niftymodaldialogeffects.lib.effects.BaseEffects.<init>(BaseEffects.java:46)
06-15 01:01:23.472: E/AndroidRuntime(2218): at com.gitonway.lee.niftymodaldialogeffects.lib.effects.SlideTop.<init>(SlideTop.java:23)
06-15 01:01:23.472: E/AndroidRuntime(2218): at java.lang.Class.newInstanceImpl(Native Method)
06-15 01:01:23.472: E/AndroidRuntime(2218): at java.lang.Class.newInstance(Class.java:1319)

原因与解决方案

Right click on your project goto properties. Java Build Path. Choose Order export tab. Make sure that Android Private Libraries is selected. If you have referenced library project. do the same for the library project also. Clean and Build.

Also goto android sdk manager and check that you have the android sdk build tools installed. This many not be necessary bumake sure you have android build tools installed.


简而言之:勾选Build Path 下的Order and Export中对应jar包

展开阅读全文

没有更多推荐了,返回首页