java.lang.NoClassDefFoundError in Eclipse, but not with Ant

狂风中的少年 提交于 2019-12-06 03:27:24

I just hit this same problem. In my case I had it set properly for the Java build path but forgot to add the library. Go to Properties -> Android then click "Add..." in the Library section then add the library project. After that it ran as expected.

Sometimes the android plugin does not generate the resources very well which cause to such issues. Try following simple procedure:

  1. Change some id in one of the layout xml and save the xml (any layout that is in the project will do).
  2. After the project compiled by the plug in change the id back and save.

If this is the problem then it should solve it after the project compiled.

I solved including the jar in the buildpath of the final project. The buildpath of the library apparently was not enough.

It sucks, but at the least it works.

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