Android 中的 ClassDefNotFound
我一直在努力尝试将我的实用程序罐子包含在我的项目中。 Android 文档明确指出,所有 import-via-filesystem 都不是必需的(http://developer.android.com/resources/faq/commontasks.html#addexternallibrary),但我已经尝试了所有建议;放入 libs 文件夹,清理项目,重新启动 eclipse。
有什么方法可以看到 eclipse 如何构建项目吗?我想看到它实际上试图包含我的罐子。
I've been jumping through hoops trying to include my utility jar in my project. Android documentation clearly states that all the import-via-filesystem should not be necessary (http://developer.android.com/resources/faq/commontasks.html#addexternallibrary) but I've tried all suggestions anyhow; putting in it a libs folder, clean the project, restarting eclipse.
Is there any way I can see how eclipse builds the project; I'd like to see that it actually tries to include my jar.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
构建和清理还不够,您应该通过配置构建路径来添加 jar 文件。请按照下列步骤操作:
希望它有帮助,对我的英语感到抱歉
Build and Clean is not enough, you should add your jar file by configuring the Build Path. Follow these steps:
Hope it helps and sorry for my English
看来将 jar 添加到构建路径还不够。您必须将 jar 复制到项目的文件夹(例如 /libs)。
It seems that adding the jar to the build path isn't enough. You have to copy the jar to the project's folder (like to /libs).
我一直无法解决这个问题,但这似乎是由于Android交叉编译器无法正确处理生成的Jar造成的。作为解决方法,我开始将 java 文件从实用程序项目复制到 Android 项目中。
I was never able to solve the problem, but it seems to be caused by the Android cross compiler not being able to correctly process the generated Jar. As a work around I started copying the java files from the utility project into the Android project.