我使用的是与错误消息冲突的facebook-android-sdk:4.20.+和com.android.support库:
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.2.0, 25.0.0. Examples include com.android.support:animated-vector-drawable:25.2.0 and com.android.support:customtabs:25.0.0 less... (⌘F1)
There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion.)下面是我的依赖项。
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:customtabs:25.0.0'
compile 'com.android.support:design:25.+'
compile 'com.android.support:cardview-v7:25.+'
compile 'com.android.support:recyclerview-v7:25.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.7.4'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.4'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.4'
compile 'org.jsoup:jsoup:1.8.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'commons-io:commons-io:2.4'
compile 'com.google.android.gms:play-services-analytics:10.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
testCompile 'junit:junit:4.12'
}在使用:./gradlew -q dependencies app:dependencies --configuration compile运行gradle依赖关系报告时,下面是facebook-android-sdk的结果。
+--- com.facebook.android:facebook-android-sdk:4.+ -> 4.20.0
| +--- com.android.support:support-v4:25.0.0 -> 25.2.0 (*)
| +--- com.android.support:appcompat-v7:25.0.0 -> 25.2.0 (*)
| +--- com.android.support:cardview-v7:25.0.0 -> 25.2.0 (*)
| +--- com.android.support:customtabs:25.0.0
| | +--- com.android.support:support-compat:25.0.0 -> 25.2.0 (*)
| | \--- com.android.support:support-annotations:25.0.0 -> 25.2.0
| \--- com.parse.bolts:bolts-android:1.4.0
| +--- com.parse.bolts:bolts-tasks:1.4.0
| \--- com.parse.bolts:bolts-applinks:1.4.0
| \--- com.parse.bolts:bolts-tasks:1.4.0我必须使用的依赖项的正确组合是什么?
发布于 2017-05-17 12:55:06
在您的具体案例中,问题在于facebook与com.android.support:customtabs:25.0.0有依赖关系,而且该版本已经过时,您当前版本的支持库是25.2.0。
正如您可以在依赖关系图上看到的,新版本的cardview v7、appcompat-v7和support-v4已经被使用,所以您可以尝试添加:
编译‘com.android.Support:customtab:25.2.0’
到依赖项,以便facebook也使用较新版本的定制选项卡。
这个答案可能也很有用:包含facebook后的分级错误
发布于 2017-11-06 04:27:49
以前的答案并没有解决我的问题。但是,基于这个响应Facebook依赖冲突,它可以工作。
https://stackoverflow.com/questions/43224410
复制相似问题