faizal
faizal

Reputation: 3565

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?

Upvotes: 7

Views: 10414

Answers (4)

MeCurious
MeCurious

Reputation: 1

  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

Upvotes: 0

Vaishali Sutariya
Vaishali Sutariya

Reputation: 5121

  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

Upvotes: 0

cokeby190
cokeby190

Reputation: 609

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

Upvotes: 18

Michal Žídek
Michal Žídek

Reputation: 494

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.

Upvotes: 2

Related Questions