0

I've just updated some things with the SDK and donwloaded update for the ADT. Now I get a red exclamation mark in the Project folder.

The console tells this:

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: C:\Media\Eclipse Workspace\project1\libs\android-support-v4.jar
Path: C:\Media\adt-bundle-windows-x86_64-20130522\sdk\extras\google\google_play_services\
         libproject\google-play-services_lib\libs\android-support-v4.jar
Jar mismatch! Fix your dependencies

Had to say, that I created a project importing google-play-services_lib to set as library in other projects ass this where I had to use google maps.

In Java Build Path\Android Private Libraries I've got 2: google-play-services.jar and android-support-v4.jar.

masmic
  • 3,526
  • 11
  • 52
  • 105
  • have updated the sdk manager ,why because we have andriode -19 version... – vinay Maneti Nov 11 '13 at 15:01
  • yes, I just updated the SDK, this is why I'm having this problem – masmic Nov 11 '13 at 15:03
  • then try to clean all the project and by going to eclipse,click on Help on the menu bar and then go to check for updates ..... and even you can restart the eclipse(or)even u can right click on the project go to Android tools -->click on Add supported Library and even click on fix project properties.. – vinay Maneti Nov 11 '13 at 15:04

4 Answers4

1

The console is telling you that you have to different copies of the support library. When Eclipse sets up the project for the first time it will add a copy of the support library. This copy is probably different than the one that comes with google play services library. Make sure that there is a consistent version of the support library across your project.

Emmanuel
  • 13,083
  • 4
  • 39
  • 53
  • In Java Build Path\Android Private Libraries I've got 2: google-play-services.jar and android-support-v4.jar. Wich one delete? – masmic Nov 11 '13 at 14:59
  • What do you reffer with project structure? – masmic Nov 11 '13 at 15:02
  • if you look at your project there is a libs folder where the .jars are stored. You need to make sure that the libs folder on the google-play-services_lib contains the same copy of the android-support-v4.jar as the libs folder in your project. – Emmanuel Nov 11 '13 at 15:05
  • If I do project properties\Java build path and remove Android Dependences, the error dissapears. Then I do project android tools\add support library and appears again. Could this be because I have a library-project created for the google-play-services_lib and in this last update the SDK adds this library automatically and I have 2 versions of this lib?? – masmic Nov 11 '13 at 15:10
  • google-play-services_lib always comes with a version of the support library, so yes you have two different copies. – Emmanuel Nov 11 '13 at 15:13
  • I've deleted the library project google-play-services_lib but now I've got several errors with the imports of some projects where I was using this library cause by some imports that need google libraries. I'm trying to add suport libraries of google on the projects but can't – masmic Nov 11 '13 at 15:18
  • 1
    You do not need to delete google-play-services_lib. The only thing you need to do is copy the same support library .jar. Go to the google-play-services_lib and into its libs folder. Then paste the same copy of the android support library as you have on your project's libs folder – Emmanuel Nov 11 '13 at 15:21
  • I found that is giving me an error on the google-play-services_lib project: `Unable to resolve target 'android-8'` – masmic Nov 11 '13 at 15:35
1

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

You can refer to This and This .

Community
  • 1
  • 1
Amit Gupta
  • 8,914
  • 1
  • 25
  • 33
  • If I do project properties\Java build path and remove Android Dependences, the error dissapears. Then I do project android tools\add support library and appears again. Could this be because I have a library-project created for the google-play-services_lib and in this last update the SDK adds this library automatically and I have 2 versions of this lib?? – masmic Nov 11 '13 at 15:11
1

For each project and library, right click on your project in Eclipse go to Android Tools > Add Support Library. This will download the latest version. Upon doing this on each referenced project and library, they should all then have the same version of the support library and you should no longer see this error message.

Boardy
  • 35,417
  • 104
  • 256
  • 447
  • If I do project properties\Java build path and remove Android Dependences, the error dissapears. Then I do project android tools\add support library and appears again. Could this be because I have a library-project created for the google-play-services_lib and in this last update the SDK adds this library automatically and I have 2 versions of this lib?? – masmic Nov 11 '13 at 15:11
  • When you remove the Android Dependencies from the build path, and then re-add the support library, that is effectively re-adding the android dependencies. You need to right click on each project and library and say Add support library. It doesn't matter if it is already included, you don't need to remove it first, it will just update to the latest version. It may also be worth doing it to the google play services library. I've had do this before in the past – Boardy Nov 11 '13 at 15:14
  • I found that is giving me an error on the google-play-services_lib project: `Unable to resolve target 'android-8'` – masmic Nov 11 '13 at 15:34
  • Google Play Services only supports from API 10 which is Gingerbread as stated at http://developer.android.com/google/play-services/setup.html. API 8 is Froyo, therefore for you're app to use Google Play Services you will need to change the minimum android SDK in your manifest to be Gingerbread. This should resolve your issue – Boardy Nov 11 '13 at 16:27
0

Finally I solved.

  • I removed and installed the "Google Play Services" from the SDK.
  • Import again the google-play-services_lib project
  • On Other project's properties in the android tab delete the library and add again
  • Copy the lastest android-support-v4.jar to the libs folder
masmic
  • 3,526
  • 11
  • 52
  • 105
  • how is this different than any of the answers we provided? – Emmanuel Nov 11 '13 at 16:30
  • Is just setting here all the steps to indicate how I solved it. Each answer indicates a way to solve it, but not all of them together, and I solved it thanks to all of them. So I don't think it's fair to accept one in concrete if all of them have been useful. So, what do you propose? For the momento I'm giving all of you an upvote for your help. Tell me wich one do you think that can be the most useful answer and I will accept it. – masmic Nov 12 '13 at 08:54
  • It is up to you to decide. If you do not think there is one answer that fits, mark your answer as the selected answer. – Emmanuel Nov 12 '13 at 15:14