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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 21:47:25  来源:igfitidea点击:

android-support-v4.jar dependency error

androideclipseandroid-support-library

提问by faizal

I just created a new blank Android project with minsdkas 2.2 in the latest Eclipse Luna.Eclipse automatically added an android-support--v4.jarin 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 :

你只需要:

  1. Right Click the project myNewProject
  2. Go To "Android Tools" > "Add Support Library"
  3. Approve the permissions and let it update the library
  4. Repeat this process for the project appcompat_v7
  1. 右键单击项目 myNewProject
  2. 转到“Android 工具”>“添加支持库”
  3. 批准权限并让它更新库
  4. 对项目 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

  1. Right Click the project demoProject
  2. Go To "Android Tools" > "Add Support Library"
  3. Approve the permissions and let it update the library
  4. Repeat this process for the project appcompat_v7 (or any library
  1. 右键单击项目 demoProject
  2. 转到“Android 工具”>“添加支持库”
  3. 批准权限并让它更新库
  4. 对项目 appcompat_v7(或任何库

回答by MeCurious

  1. Look at the paths of the discrepancies
  2. Delete the one under the project > libs folder
  3. Copy the one from the appcompat libs folder to the project libs folder
  4. Close and reopen Eclipse
  5. Clean project
  1. 查看差异的路径
  2. 删除project > libs文件夹下的那个
  3. 将 appcompat libs 文件夹中的一个复制到项目 libs 文件夹中
  4. 关闭并重新打开 Eclipse
  5. 清洁工程