gpt4 book ai didi

android - jar 不匹配!修复你的依赖

转载 作者:IT老高 更新时间:2023-10-28 13:13:33 26 4
gpt4 key购买 nike

重现步骤:

  1. 创建一个安卓项目“MyApp”
  2. 导入 ActionBarSherlock(ABS)、Directional ViewPager(DVP) 或任何其他使用 android 支持库的开源库。
  3. 将库添加到项目“MyApp”中

控制台日志:

[2013-04-17 14:27:12 - MyApp] Found 2 versions of android-support-v4.jar in the dependency list,
[2013-04-17 14:27:12 - MyApp] but not all the versions are identical (check is based on SHA-1 only at this time).
[2013-04-17 14:27:12 - MyApp] All versions of the libraries must be the same at this time.
[2013-04-17 14:27:12 - MyApp] Versions found are:
[2013-04-17 14:27:12 - MyApp] Path: C:\Users\santhosh\My_Workspace\DVP_library\libs\android-support-v4.jar
[2013-04-17 14:27:12 - MyApp] Length: 140011
[2013-04-17 14:27:12 - MyApp] SHA-1: fc834ac8147bc4ed0b555f90f500a57d4232c448
[2013-04-17 14:27:12 - MyApp] Path: C:\Users\santhosh\My_Workspace\abs_library\libs\android-support-v4.jar
[2013-04-17 14:27:12 - MyApp] Length: 271754
[2013-04-17 14:27:12 - MyApp] SHA-1: 53307dc2bd2b69fd5533458ee11885f55807de4b
[2013-04-17 14:27:12 - MyApp] Jar mismatch! Fix your dependencies

我知道我想从 libs 文件夹中删除 android-support-v4.jar 并为所有人保留一份副本。但是,这并不能解决我的问题。

当我尝试从 MyApp 中删除 android-support-v4.jar 时,出现以下错误。

 Problems encountered while deleting resources.
Could not delete 'C:\Users\santhosh\My_Workspace\MyApp\libs\android-support-v4.jar'.

当我尝试从 ABS 中删除 android-support-v4.jar 时,出现以下错误

 ????? cannot be resolved to a type error.

我已尝试清理项目,修复项目属性。重启eclipse,再次构建,导入并添加。我试图将 libs 文件夹中的支持 jar 从一个库复制到另一个库。删除两个库中的支持 jar 并将其添加到 MyApp 项目中。没有什么对我有用。

如果我尝试添加单个库,它工作正常。我在尝试将 2 个或更多库添加到单个项目时遇到了问题。

在 MyApp 中添加两个库时出错:

The project was not built since its build path is incomplete. 
Cannot find the class file for android.support.v4.app.FragmentActivity.
Fix the build path then try building this project MyApp Unknown Java Problem
The type android.support.v4.app.FragmentActivity cannot be resolved. It is indirectly referenced from required .class files MyActivity.java/MyApp/src/com/santhosh/myapp line 10 Java Problem
Jar mismatch! Fix your dependencies MyApp Unknown Android Dependency Problem

最佳答案

不要在库中包含 android-support-v4,而是可以使用 build path menu > add external jar 将其作为外部 jar 添加到项目中

有时你必须清理你的项目。

关于android - jar 不匹配!修复你的依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16056914/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com