java.lang.NoClassDefFoundError: com.baidu.mlocTest.MyLocationListenner

来源:互联网 发布:修改sftp端口 编辑:程序博客网 时间:2024/03/29 06:04

 

Android SDK更新后 ADT R17 E/AndroidRuntime : java.lang.NoClassDefFoundError问题的解决

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

原创粉丝点击