简体   繁体   English

罐子不匹配!修复您对FacebookSDK的依赖关系

[英]Jar mismatch! Fix your dependencies for the FacebookSDK

I want to do Login with facebook. 我想用facebook登录。 I am following this Steps .It's all working perfact. 我正在遵循这些步骤。这一切都在努力。 But when I am going to Create a new Android Project with Facebook Login STEP-6 into above link I got the error of the Jar mismatch . 但是,当我要Create a new Android Project with Facebook Login STEP-6 Create a new Android Project with Facebook Login到上面的链接时,我得到了Jar mismatch的错误。

when I create new android application that time there is no any errors, but when add the FacebookSDK to the newly create project. 当我创建新的Android应用程序时,没有任何错误,但将FacebookSDK添加到新创建的项目时。 that time it gives 它给出的那个时间

Jar mismatch! Fix your dependencies  |   Unknown Android Dependency Problem

I tried everything to change the java compiler level but not getting. 我尝试了一切来改变java编译器级别,但没有得到。

I tried project properties > Java compiler > In this level I do all changes of the java versions, but not success. 我试过项目属性> Java编译器>在这个级别我做了java版本的所有更改,但没有成功。

any help please? 有什么帮助吗?

Thank you. 谢谢。

Try to remove the android-support-v4.jar file from the libs folder of your project. 尝试从项目的libs文件夹中删除android-support-v4.jar文件。

Good Luck. 祝好运。

If there is any JAR file with same name in the libs folder of the Library and your Project , they must have the same size(same jar files). 如果项目libs文件夹中有任何具有相同名称的JAR文件,则它们必须具有相同的大小(相同的jar文件)。

If now just replace one of them with the other 如果现在只用另一个替换其中一个

The Android FacebookSDK includes its own version of android-support-v4.jar , and it's most likely the conflicting jar . Android FacebookSDK包含自己版本的android-support-v4.jar ,它很可能是冲突的jar

Open project preferences, select Java Build Path and remove android-support-v4.jar from the root, and things should compile well again. 打开项目首选项,选择Java Build Path并从root中删除android-support-v4.jar ,事情应该再次编译好。

I think there exist a better solution for solving this problem than removing the android-support jar being used. 我认为有一个更好的解决方案来解决这个问题,而不是删除正在使用的android-support jar。 It might cause some other errors to your project. 它可能会导致您的项目出现其他一些错误。 I solved this problem by removing the support jar of fb sdk and then updating its support library to the version we have in our project and then add the library project to your project and it will compile with out any errors 我解决了这个问题,删除了fb sdk的支持jar,然后将其支持库更新为我们项目中的版本,然后将库项目添加到项目中,它将编译出任何错误

This is happening because the FacebookSDK brings with it its own version of android-support-v4.jar. 发生这种情况是因为FacebookSDK带来了自己的android-support-v4.jar. You may remedy this by following these steps: 您可以通过以下步骤解决此问题:

  1. Delete android-support-v4.jar from your own android project 从你自己的android项目中删除android-support-v4.jar
  2. Delete android-support-v4.jar from appcompat_v7 appcompat_v7删除android-support-v4.jar appcompat_v7
  3. Copy android-support-v4.jar from your FacebookSDK project 从您的FacebookSDK项目复制android-support-v4.jar
  4. Paste this copied jar in the places where you deleted the others 将此复制的jar粘贴到您删除其他jar的位置

This is less risky then outright deleting the jars from the two projects. 这比从两个项目中直接删除罐子的风险要小。 This not only remedies SHA-1 hash issues. 这不仅可以解决SHA-1哈希问题。 It will also help with res errors that may popup in your appcompat_v7 project post addition of the FacebookSDK into your project. 它还有助于在将FacebookSDK到项目中后, appcompat_v7项目中可能弹出的res错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM