Updated SDK Tools and ADT to 17 and now getting VerifyErrors

柔情痞子 提交于 2019-12-03 00:27:50

I had the exact same problem. Finding this post: How to fix the “NoClassDefFoundError” with ADT 17 save me some frustration.

Whew, that was scary but I just tried a ton of different things until it worked. Somewhere within all of this, it resolved it. My library project has a handful of jars added to the "lib" folder and attached to the build path.

I read this change log note: http://tools.android.com/recent/dealingwithdependenciesinandroidprojects about changes to libraries and dependencies. I noticed this:

Projects have source folders, as well as Library Project and jar file dependencies. With no other setup needed than adding Library Projects as a dependency in project.properties, a project’s classpath is automatically populated with:

The content of the project’s libs/*.jar
The output of the Library Projects.
The Library Projects’ libs/*.jar

For some reason, my library project's folder was named "lib" not "libs". I have been using it that way for nearly two years without any problems, but I went ahead and changed it to "libs". I then refreshed the project, and turned the "is Library" flag off, and then on again to make sure it saw that change.

Also, with the new tools, they mention that it handles including the library project's jars in the project that references the library. Up to this point I had added the library project's jars to the referencing project manually. So I went into the referencing project, and removed the jars from the build path. I then when into the project properties and removed the library project and re-added it.

Lastly, I noticed a jar file was in the library project's folder, but wasn't being used. It was just in the folder. I removed that file.

So somewhere in there it started working again. I imagine the real fix was changing "lib" to "libs" but I wanted to make sure I mentioned it all in case it helps any other developers experiencing fear and panic in their hearts. Good luck!

@kargi

As a rule, I think the solution here and here is a very bad practice. Maven solved this preposterous lib folder business long time ago, but Maven is also not very efficient building Android, so I would recommend using Eclipse export feature, as I describe here.

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