Fault Jar! Fix your dependencies

Steps to play:

  • create an android project "MyApp"
  • Import an ActionBarSherlock (ABS), Directional ViewPager (DVP), or any other open source library that uses the Android support library.
  • Add libraries to the MyApp project

Console Log:

[2013-04-17 14:27:12 - MyApp] Found 2 versions of android-support-v4.jar in the dependency list, [2013-04-17 14:27:12 - MyApp] but not all the versions are identical (check is based on SHA-1 only at this time). [2013-04-17 14:27:12 - MyApp] All versions of the libraries must be the same at this time. [2013-04-17 14:27:12 - MyApp] Versions found are: [2013-04-17 14:27:12 - MyApp] Path: C:\Users\santhosh\My_Workspace\DVP_library\libs\android-support-v4.jar [2013-04-17 14:27:12 - MyApp] Length: 140011 [2013-04-17 14:27:12 - MyApp] SHA-1: fc834ac8147bc4ed0b555f90f500a57d4232c448 [2013-04-17 14:27:12 - MyApp] Path: C:\Users\santhosh\My_Workspace\abs_library\libs\android-support-v4.jar [2013-04-17 14:27:12 - MyApp] Length: 271754 [2013-04-17 14:27:12 - MyApp] SHA-1: 53307dc2bd2b69fd5533458ee11885f55807de4b [2013-04-17 14:27:12 - MyApp] Jar mismatch! Fix your dependencies 

I know that I want to remove android-support-v4.jar from the libs folder and save only one copy for everyone. But that does not solve my problem.

When I try to remove android-support-v4.jar from MyApp , it gives me the following error.

  Problems encountered while deleting resources. Could not delete 'C:\Users\santhosh\My_Workspace\MyApp\libs\android-support-v4.jar'. 

When I try to remove android-support-v4.jar from ABS , it gives me the following error

  ????? cannot be resolved to a type error. 

I tried to clean the project, Fix project properties. Restart eclipse, create, import and add again. I tried to copy the support jar to the libs folder from one library to another. delete the support jar in both libraries and add it to the MyApp project. Nothing worked for me.

if I try to add one library, it works fine. I encountered a problem while trying to add 2 or more libraries to one project.

Error adding two libraries to MyApp:

 The project was not built since its build path is incomplete. Cannot find the class file for android.support.v4.app.FragmentActivity. Fix the build path then try building this project MyApp Unknown Java Problem The type android.support.v4.app.FragmentActivity cannot be resolved. It is indirectly referenced from required .class files MyActivity.java/MyApp/src/com/santhosh/myapp line 10 Java Problem Jar mismatch! Fix your dependencies MyApp Unknown Android Dependency Problem 
+71
android eclipse jar
Apr 17 '13 at
source share
10 answers

Use library project only for support library

Like ADT 22 using Eclipse Juno

I do not think that any of the above are really the best answers. I also don’t think it is recommended to use the external jar function in Eclipse anymore (AFAIK).

Most likely, it worked for me to create a separate empty library project.

Then use Android tools > Add Support Library to get the latest version that you need or want.

Then remove the lib support byte from all other projects .

Finally, for each required project add a link to a new library project

(project properties) > Android > (Library box) > Add...

Then all your projects will have one source for using and updating the support library. It also simplifies javadocs.

For information on configuring javadocs, see:

How to connect javadoc or sources to banks in the libs folder?

+49
Aug 04 '13 at 1:44 on
source share
— -

Do not include android-support-v4 support in the library, instead you can add it to your project as an external jar using the build path menu> add external jar

Sometimes you need to clean your project.

+55
Apr 30 '13 at 13:15
source share

Delete the android-support-v4.jar from the libs folder from your project.

+17
Apr 17 '13 at 12:09 on
source share

Actionbarsherlock has a support library. This is likely to cause a conflict if the support library is also in your main project.

Remove android-support-v4.jar from the projects directory.

Also remove android-support-v4.jar from the second library, and then try again.

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

+7
Apr 17 '13 at 9:53 on
source share

I agree with pjco. The best way is the official method described in the Support Library Setup in the developer.android.com tutorial.

Then, in the Eclipse Explorer , expand your main project and remove android-support-v4.jar from the "libs" . Strong> (like Pratik Butani ).

It worked for me.

+5
Dec 23 '13 at 3:59
source share
  • Jar mismatch occurs when you use library projects in your application and both projects use the same jar with a different version, so just check all the library projects attached in the application. if there is some discrepancy, remove it.

  • If the above process does not work, just remove the project’s dependency on the build path and add the library projects again and create the application.

+4
Jun 11 '14 at 9:40
source share

I believe that you need a support package both in the library and in the application. However, to fix this, make sure you have the same file in both places (same checksum).

Just copy the support package file from one place and copy it to another, then clean + refresh your library / project and you should be good to go.

+1
Apr 17 '13 at 9:54 on
source share

I think that you create a new workspace and correctly import the entire project with its lib, and also add the external jar android-support-v4.jar to the adb package in additional sdk files. I think his work is for you. Hope all the best

And also use android support to support Android, as well as update the adt package

+1
Sep 23 '14 at 5:44
source share

In my case, there was a different directory in my workspace that had the same jar file as in my project. I did not create this directory or anything in it. It was created by Eclipse, I believe. I just deleted this directory and it just works fine.

0
Nov 20 '15 at 12:16
source share

Right click on your project -> Android Tool -> Add Support Library

0
Jun 01 '16 at 19:12
source share



All Articles