Android(安卓)SDK更新后 ADT R17 E/AndroidRuntime : java.lang.NoClassDefFoundError问题的解决
16lz
2021-01-24
更新了Android SDK 和ADT 到 R17 以后出现了一个问题,就是原来所有引入第三方的jar文件的项目,运行到一旦调用了第三方jar文件里的类的地方,都会出现类似
E/AndroidRuntime : java.lang.NoClassDefFoundError的错误。
后来看国外的网站才解决问题http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17/comment-page-1#comment-4346
简单的说一下解决方法:
- 将所有的第三方jar文件从 standard Java build path中移除 :
- 右键项目名 > Properties > Java Build Path > tab Libraries >将 “Android X.X”and the “Android Dependencies”之外的所有jar文件引用全部去除
- 重命名lib文件夹 为libs
- t一旦这样做了以后,libs库文件夹就能被Android plugin 添加到“Android Dependencies” 条目里。
- Clean the project (非必要)
- 一切OK。
这个问题的原因:
- This problem is due to the fact that libraries are not managed the same way with the new ADT build.
- Instead of having 2 different managements of libraries (one for Android Library Projects, one for the standard jars), now both are merged into the Android Dependencies item.
原文:http://www.cnblogs.com/changety/articles/Android_ADT_SDK_v17_AndroidRuntime.html
更多相关文章
- 下载android sdk更新包离线安装解决方案
- Android使用Aidl实现跨进程通信
- Android性能测试工具(一)之Emmagee
- 使用Android(安卓)Studio为系统级的app签名
- Android练手小项目(KTReader)基于mvp架构(三)
- Android(安卓)setContentView 实现同一个activity下不同view的切
- android 本地数据库sqlite的封装
- Android之底部導航欄--RadioGroup、TabHost、TabActivity
- Android(安卓)Studio 怎么添加使用第三方jar包及无法编译的问题