Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook SDK for Android duplicate support library on dependencies

I have implemented the new Facebook SDK 3.0 beta. The library project contains the Android support library v4. I also have the support library on my own proyect (a different version though). When I add the Facebook SDK as a library I get the next error on the console:

Jar mismatch! Fix your dependencies 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. 

I've tried to exclude the libs folder on the buildpath, but the error remains.

I have to put the same .jar in both places. Am I missing something here? The idea is to use the support library of my own project (to keep it updated).

like image 388
nsemeniuk Avatar asked Nov 22 '12 17:11

nsemeniuk


People also ask

How did you integrate the Facebook SDK in Android app?

Create Your Project To use the Facebook SDK in an Android Studio project, add the SDK as a build dependency and import the SDK. Go to Android Studio | New Project | Minimum SDK. Select API 15: Android 4.0.

On which platform does the Facebook SDK works on?

To learn more about using Facebook development tools, see App Development. The current version of the Facebook SDK for Android is version 15.0. 0 and requires the Android API 15. Code and samples for the Facebook SDK for Android are available on GitHub.

What is the use of Facebook SDK?

The Facebook SDK is a set of software components that developers can include in their mobile app to understand how people use the app, run optimized marketing campaigns and enable Facebook login and social sharing.


2 Answers

It seems like the different projects are using two separate support libraries and therefore the checksum is different.

You must repeat this for both the Facebook SDK project and the app you are building.

What I do when I get this error is:

  1. Right click the project.

  2. Hover over Android Tools.

  3. Click on "Add support library..."

  4. Accept the downloading of the library.

This insures two things: a. you get the newest version of the support library from the Google sources, and b. you have the EXACT same library in all your projects.

Happy coding!

like image 159
thepoosh Avatar answered Sep 28 '22 02:09

thepoosh


Simply delete the one in your project, remove it from the class path and try rebuild your project.

like image 21
Neil Avatar answered Sep 28 '22 02:09

Neil