更新了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

更多相关文章

  1. 下载android sdk更新包离线安装解决方案
  2. Android使用Aidl实现跨进程通信
  3. Android性能测试工具(一)之Emmagee
  4. 使用Android(安卓)Studio为系统级的app签名
  5. Android练手小项目(KTReader)基于mvp架构(三)
  6. Android(安卓)setContentView 实现同一个activity下不同view的切
  7. android 本地数据库sqlite的封装
  8. Android之底部導航欄--RadioGroup、TabHost、TabActivity
  9. Android(安卓)Studio 怎么添加使用第三方jar包及无法编译的问题

随机推荐

  1. Android(安卓)热点开关状态的判断和获取
  2. Android(安卓)version and Linux Kernel
  3. Android平台上优秀的开源项目
  4. [RK3399][Android7.1.1] WifiAp:开机默认
  5. Android之菜单总结
  6. android ndk编译x264开源(用于android的f
  7. 在Fragment中设置控件点击方法,执行失败。
  8. use ffmpeg to setup streaming server o
  9. Android(安卓)MediaPlayer 常用方法介绍
  10. Android(安卓)studio3.x 多渠道打包apk