2

I have created an app and need to use two diffrent android support lib as methods I have used are not avialable in one lib.One lib I have used is ABS for sliding menu and second one is ActionBarSherelock and both are using different android support lib.When I use both in my project I got this error.

LogCat :

Found 2 versions of android-support-v4.jar in the dependency list,
        \[2014-01-13 11:26:17 - phoneCall\] but not all the versions are identical (check is based on SHA-1 only at this time).
        \[2014-01-13 11:26:17 - phoneCall\] All versions of the libraries must be the same at this time.
        \[2014-01-13 11:26:17 - phoneCall\] Versions found are:
        \[2014-01-13 11:26:17 - phoneCall\] Path: /root/AndroidHome/AndroidWorkspace/ActionBarSherlock/libs/android-support-v4.jar
        \[2014-01-13 11:26:17 - phoneCall\]     Length: 385685
        \[2014-01-13 11:26:17 - phonecall\]     SHA-1: 48c94ae70fa65718b382098237806a5909bb096e
        \[2014-01-13 11:26:17 - phone91\] Path: /root/AndroidHome/AndroidWorkspace/ABS/libs/android-support-v4.jar
        \[2014-01-13 11:26:17 - phoneCall\]     Length: 484258
        \[2014-01-13 11:26:17 - phoneCall\]     SHA-1: bd6479f5dd592790607e0504e66e0f31c2b4d308
        \[2014-01-13 11:26:17 - phoneCall\] Jar mismatch! Fix your dependencies

I have referred this solution and tried to resolve but it is showing error in mainactivity on

 import android.support.v4.app.ActionBarDrawerToggle;
 import android.support.v4.view.GravityCompat;
 import android.support.v4.widget.DrawerLayout

Please tell me how to resolve this .

Community
  • 1
  • 1
Sneha Bansal
  • 941
  • 1
  • 13
  • 38
  • Try by removing android.support.v4.jar of your application.Then clean and build. – Zankhna Jan 13 '14 at 06:17
  • Have you tried referring your main project's android support v4 to your library project instead of copying it? I mean by deleting the v4 support from the other project then, go to its build path. Select the Libraries tab. You'll find "Add Jar". Click that button then choose your main project's v4 support library. If you haven't tried this, I'll put it as answer. – vida Jan 13 '14 at 06:20
  • @vida what I have done till now is I have removed jar from ABS and copid jar of action bar sherelock in it.But then my project required some classes which are not availabe in that support libs and have deleted projects jar already . – Sneha Bansal Jan 13 '14 at 06:26
  • @Bansal_Sneha I see. So you are using 2 different versions of v4 support lib? Do you know what specific versions of v4 support are you using? Also, what's the specific error in MainActivity? – vida Jan 13 '14 at 06:30
  • @vida both lib showing revise version 19 and when I deleted jar of abs and copied support lib from action shereloack bar to make same I am getting error mentioned in question – Sneha Bansal Jan 13 '14 at 06:33
  • @Bansal_Sneha Could you try the steps I have indicated above and tell me if the mismatch error still occur? Instead of copying, do the "Add jar" instead. – vida Jan 13 '14 at 06:41
  • @vida which jar should I add .Jar of ABS or Jar of action bar sherelock lib ? – Sneha Bansal Jan 13 '14 at 06:44
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/45091/discussion-between-vida-and-bansal-sneha) – vida Jan 13 '14 at 06:45

3 Answers3

1

All you need is to Delete Android’s default support library if exists from the project,

By default, Eclipse adds Android’s Support library to the project. We don’t want to use this library for this project. This library will be available in the folder “libs” in the name “android-support-v4.jar“. Delete this jar file from the “libs” folder

Ref Point Number 6 : http://wptrafficanalyzer.in/blog/implement-swiping-between-tabs-with-viewpager-in-action-bar-using-sherlock-library/

Kitkat
  • 77
  • 16
  • I thought there should be one jar per project and if I am right there will be still mismatch happen as I have two different jar in to lib's. – Sneha Bansal Jan 13 '14 at 06:24
  • First try your self and then tell me. I got same error and I tried this step, It is working at my side. – Kitkat Jan 13 '14 at 06:25
  • same error as . ihave copied ABS jar in project but Actionbar sherelock lib still have different lib – Sneha Bansal Jan 13 '14 at 06:38
1

Make sure that android-support-v4.jar in the application and in the ActionBarSherlock app are same so please copy android-support-v4.jar from ABS lib and use it in yours project as well.

follow these steps,

  1. Go to ABS Project's lib folder and copy android-support-v4.jar file
  2. Paste .jar file into your current project
  3. Clean and refresh the project
Kitkat
  • 77
  • 16
Jitesh Upadhyay
  • 5,244
  • 2
  • 25
  • 43
0

Your android-support-v4.jar in the application and in the ActionBarSherlock app are of different versions. Just delete that jar from your app and copy the new one from ActionBarSherlock library project to make the version same.

amit singh
  • 1,407
  • 2
  • 16
  • 25