尝试在 Eclipse 中包含 Maven 构建的库,出现丢失工件错误
我看到有很多关于这个问题的问题,但不幸的是没有人为我解决它。这是所发生情况的屏幕截图:
它依赖于 android-support-v4 jar 文件如您所见,它已添加到我的构建路径中。它是 Maven 库目录的 libs 文件夹中的确切 jar 文件。我已尝试以下操作:
- 重新启动 Eclipse
- 清理项目
- 右键单击项目并更新依赖
- 项 更新项目配置 禁用并重新启用工作区解析
没有任何帮助。还有其他技巧可以解决这个问题吗?我看到的所有答案都建议做我已经尝试过的这些事情。
多谢!
I've seen that there are quite a few questions regarding this problem, but unfortunately none have solved it for me. Here is a screencap of what's going on:
It is dependent on the android-support-v4 jar file which as you can see is added to my build path. It the exact jar file from the maven library directory's libs folder. I've tried the following:
- Restarting Eclipse
- Cleaning the project
- Right-clicking the project and updating dependencies
- Updating project configuration Disabling and re-enabling workspace resolution
Nothing has helped. Is there any other tricks to getting this resolved? All of the answer's I've seen suggest doing these things that I have already tried.
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际根本原因:
OP JMRboosties 报告在此实例中必须停用Proguard(缩小、优化和通过删除未使用的代码并使用语义上晦涩的名称重命名类、字段和方法来混淆代码)
(请参阅“如何将 ProGuard 与 android-maven-plugin 一起使用")。
使用 Proguard 可能会产生某些副作用:例如,Proguard 页面 确实提到:
原始答案:
正如GitHub帖子中提到的:
(请注意,您的
android-support-v4.jar
不在项目的libs
中)Actual root cause:
The OP JMRboosties reports in this instance having to desactivate Proguard (the tool which shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names)
(See "How to use ProGuard with android-maven-plugin ").
Certain side-effects can result from using Proguard: For example, the Proguard page does mention:
Original answer:
As mentioned in this GitHub post:
(Note your
android-support-v4.jar
isn't inlibs
in your project)假设您在幕后使用 m2e-android,那么您遇到编译问题的原因是 m2e-android 插件从 Eclipse 项目类路径中删除了所有
provided
范围依赖项。我们这样做是因为,由于 ADT 16.0.0 中的更改,Eclipse 类路径中的任何 JAR 文件都将打包到可分发的 APK 文件中。
Assuming you're using m2e-android behind the scenes, the reason you're getting compile problems is that the m2e-android plug-in strips out all
provided
scope dependencies from the Eclipse project classpath.We do this because, due to changes in ADT 16.0.0, any JAR file in the Eclipse classpath will be packaged into distributable APK file.