Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jar Mismatch Found 2 versions of android-support-v4.jar in the dependency list

Tags:

java

android

jar

Any ideas on how to resolve this?

Delete one.

I've been playing with the build path to no success.

Step #1: Undo all that. If you are messing with the build path, on R16 or higher version of the ADT plugin for Eclipse, you're doing it wrong.

Step #2: Pick one of those two versions of the JAR, or pick the one from the "extras" area of your SDK installation.

Step #3: Put the right JAR in App Library.

Step #4: Delete the one from App Free, since it will pick up that JAR from App Library.

You are welcome to instead have the same actual JAR file in both spots (App Free and App Library), though that just takes up extra space for no reason.


  1. Delete android-support-v4.jar from App Free
  2. Add the same file from App Library to App Free

Above solutions mostly solve the problem. after using these solutions and problem persists. Then

GO to project folder -> libs-> and delete "android-support-v4.jar"

Hoping it would solve your problem as it solved my problem.


There are some scenarios where you have multiple library projects having the the android-support-v4.jar in their libs and build paths and your project has a dependency towards both of them. Say for example in my case I have the following library projects in my workspace,

  • libfacebook
  • libsherlockactionbar

Both these projects are independent and my project.properties looks like the following,

# Project target.
target=android-17
android.library.reference.1=../libfacebook
android.library.reference.2=../libsherlockactionbar

When I build my project, I get a jar mismatch problem having duplicate references to two copies of the same file. What I did to solve this issue is a bit of trickery. I created a new library project named libcommons as a parent to all the other library projects in my workspace, including libfacebook and libsherlockactionbar. Then I removed the support library from all other projects and kept only one copy inside libcommons's libs folder. Then I have added libcommons as a reference to all my other library projects. Once cleaned my workspace, everything works like a charm.


This is a more elegant fix than deleting and adding files!

You just need to :

  1. Right Click the project App Free
  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 App Library

The Android Support Library will then be in sync (: