Facebook SDK for Android duplicate support library on dependencies

依然范特西╮ 提交于 2019-11-27 13:53:09
thepoosh

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!

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

PSIXO

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!