简体   繁体   English

android-support-v4.jar依赖错误

[英]android-support-v4.jar dependency error

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. 我刚刚在最新的Eclipse Luna.Eclipse中创建了一个新的空白Android项目, minsdk为2.2,在项目的libs文件夹中自动添加了一个android-support--v4.jar This is causing an error in the console : 这导致控制台出错:

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? 我知道解决方案是删除其中一个罐子,但是哪个和为什么?

You just need to : 你只需要:

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

The Android Support Library will then be in sync (: Android支持库将同步(:

You import a appcompat_v7 library which also have a android-support--v4.jar, but different size. 你导入一个appcompat_v7库,它也有一个android-support-v4.jar,但大小不同。 Just copy android-support--v4.jar from your project library to appcompat_v7 folder. 只需将android-support - v4.jar从项目库复制到appcompat_v7文件夹即可。 Folder paths are in your post, just for information. 文件夹路径在您的帖子中,仅供参考。

  1. Right Click the project demoProject 右键单击项目demoProject
  2. Go To "Android Tools" > "Add Support Library" 转到“Android工具”>“添加支持库”
  3. Approve the permissions and let it update the library 批准权限并让它更新库
  4. Repeat this process for the project appcompat_v7 (or any library 对项目appcompat_v7(或任何库)重复此过程
  1. Look at the paths of the discrepancies 看看差异的路径
  2. Delete the one under the project > libs folder 删除项目> libs文件夹下的那个
  3. Copy the one from the appcompat libs folder to the project libs folder 将appcompat libs文件夹中的一个复制到项目libs文件夹
  4. Close and reopen Eclipse 关闭并重新打开Eclipse
  5. Clean project 清洁项目

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM