java 罐子不匹配!修复 FacebookSDK 的依赖项
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14515626/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jar mismatch! Fix your dependencies for the FacebookSDK
提问by Rahul Patel
I want to do Login with 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
.
我想用facebook登录。我正在遵循此步骤。一切正常。但是当我要Create a new Android Project with Facebook Login
进入上述链接的第 6 步时,我收到了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. that time it gives
当我创建新的 android 应用程序时没有任何错误,但是当我将它添加FacebookSDK
到新创建的项目时。那个时候它给
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.
谢谢你。
回答by Rahul Patel
Try to remove the android-support-v4.jar
file from the libsfolder of your project.
尝试android-support-v4.jar
从项目的libs文件夹中删除该文件。
Good Luck.
祝你好运。
回答by Archie.bpgc
If there is any JARfile with same name in the libsfolder of the Libraryand your Project, they must have the same size(same jar files).
如果库和您的项目的libs文件夹中有任何同名的JAR文件,它们必须具有相同的大小(相同的 jar 文件)。
If now just replace one of them with the other
如果现在只是将其中一个替换为另一个
回答by Joachim Isaksson
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
并删除android-support-v4.jar
,事情应该再次编译良好。
回答by JithinVG
I think there exist a better solution for solving this problem than removing the android-support jar being used. 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
我认为有比删除正在使用的 android-support jar 更好的解决方案来解决这个问题。它可能会导致您的项目出现其他一些错误。我通过删除 fb sdk 的支持 jar 解决了这个问题,然后将其支持库更新到我们项目中的版本,然后将库项目添加到您的项目中,它会编译没有任何错误
回答by Brian
This is happening because the FacebookSDK
brings with it its own version of android-support-v4.jar.
You may remedy this by following these steps:
发生这种情况是因为FacebookSDK
它带有自己的版本,android-support-v4.jar.
您可以按照以下步骤解决此问题:
- Delete
android-support-v4.jar
from your own android project - Delete
android-support-v4.jar
fromappcompat_v7
- Copy
android-support-v4.jar
from yourFacebookSDK
project - Paste this copied jar in the places where you deleted the others
android-support-v4.jar
从你自己的android项目中删除- 删除
android-support-v4.jar
自appcompat_v7
android-support-v4.jar
从您的FacebookSDK
项目复制- 将此复制的 jar 粘贴到您删除其他 jar 的位置
This is less risky then outright deleting the jars from the two projects. This not only remedies SHA-1 hash issues. It will also help with res
errors that may popup in your appcompat_v7
project post addition of the FacebookSDK
into your project.
这比从两个项目中彻底删除 jar 的风险要小。这不仅可以解决 SHA-1 哈希问题。它还有助于解决res
在将 加入appcompat_v7
项目后可能在项目中弹出的错误FacebookSDK
。