eclipse android-support-v4.jar 依赖错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24609066/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
android-support-v4.jar dependency error
提问by faizal
I just created a new blank Android project with minsdk
as 2.2 in the latest Eclipse Luna.Eclipse automatically added an android-support--v4.jar
in the libs folder of the project. This is causing an error in the console :
我刚刚minsdk
在最新的 Eclipse Luna.Eclipse 中创建了一个新的空白 Android 项目,其版本为 2.2。Eclipseandroid-support--v4.jar
在项目的 libs 文件夹中自动添加了一个。这导致控制台出错:
Found 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
All versions of the libraries must be the same at this time.
Versions found are:
Path: /home/faizal/DEV/ADT workspace/myNewProject/libs/android-support-v4.jar
Length: 758727
SHA-1: efec67655f6db90757faa37201efcee2a9ec3507
Path: /home/faizal/DEV/ADT workspace/appcompat_v7/libs/android-support-v4.jar
Length: 648327
SHA-1: ded9acc6a9792b8f1afc470f0c9cd36d178914cd
Jar mismatch! Fix your dependencies
This is because I also have an appcompat_v7 support library project, which I am using for another project and was created by an older Eclipse(i think it was Juno..it was part of the ADT bundle).
这是因为我还有一个 appcompat_v7 支持库项目,我正在将它用于另一个项目并且是由较旧的 Eclipse 创建的(我认为它是 Juno ..它是 ADT 包的一部分)。
I know the solution is to remove one of the jars, but which one and why?
我知道解决方案是移除其中一个罐子,但是是哪个罐子,为什么?
回答by cokeby190
You just need to :
你只需要:
- Right Click the project myNewProject
- Go To "Android Tools" > "Add Support Library"
- Approve the permissions and let it update the library
- Repeat this process for the project appcompat_v7
- 右键单击项目 myNewProject
- 转到“Android 工具”>“添加支持库”
- 批准权限并让它更新库
- 对项目 appcompat_v7 重复此过程
The Android Support Library will then be in sync (:
然后 Android 支持库将同步(:
回答by Michal ?ídek
You import a appcompat_v7 library which also have a android-support--v4.jar, but different size. Just copy android-support--v4.jar from your project library to appcompat_v7 folder. Folder paths are in your post, just for information.
您导入一个 appcompat_v7 库,该库也有一个 android-support--v4.jar,但大小不同。只需将 android-support--v4.jar 从您的项目库复制到 appcompat_v7 文件夹。文件夹路径在您的帖子中,仅供参考。
回答by Vaishali Sutariya
- Right Click the project demoProject
- Go To "Android Tools" > "Add Support Library"
- Approve the permissions and let it update the library
- Repeat this process for the project appcompat_v7 (or any library
- 右键单击项目 demoProject
- 转到“Android 工具”>“添加支持库”
- 批准权限并让它更新库
- 对项目 appcompat_v7(或任何库
回答by MeCurious
- Look at the paths of the discrepancies
- Delete the one under the project > libs folder
- Copy the one from the appcompat libs folder to the project libs folder
- Close and reopen Eclipse
- Clean project
- 查看差异的路径
- 删除project > libs文件夹下的那个
- 将 appcompat libs 文件夹中的一个复制到项目 libs 文件夹中
- 关闭并重新打开 Eclipse
- 清洁工程