Search code examples
androidfacebook-android-sdkandroid-support-library

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).


Solution

  • 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.