简体   繁体   中英

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. 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).

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
  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

The Android Support Library will then be in sync (:

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.

  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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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