Facebook SDK for Android duplicate support library on dependencies

后端 未结 3 704
长发绾君心
长发绾君心 2020-12-03 06:29

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

相关标签:
3条回答
  • 2020-12-03 07:16

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

    0 讨论(0)
  • 2020-12-03 07:20

    Installing the same version of support libraries via menus mentioned in the top answer is quite a good solution.

    Although this sometimes didn't work for me (I think it has something to do with my Workspace folder being synced with Dropbox, so Eclipse won't overwrite files sometimes) so the approach I am using is to link the support library from the central place.

    There are these JAR files inside your SDK folder (C:\Program Files (x86)\Android\android-sdk\extras\android\ on Windows for example) which is being updated when you run SDK manager, so you could just reference that one from both the Facebook (or any other library) and your projects. Since in the end, code from JAR files gets packed to your classes.dex. You don't even need the support library in the libs folder.

    Also: If you use the Gradle build system and its dependency management or even Maven you will not have problems like these, but they require more time and knowledge to set-up correctly.

    0 讨论(0)
  • 2020-12-03 07:27

    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!

    0 讨论(0)
提交回复
热议问题