‘com.android.support:animated-vector-drawables:27.0.1’
摇篮:
apply plugin: 'com.android.application' android { compileSdkVersion 26 defaultConfig { applicationId "re.tryout123" minSdkVersion 19 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro' } } } repositories { maven { url "https://jitpack.io" } maven { url 'https://maven.fabric.io/public' } maven { url 'https://maven.google.com/' name 'Google' } } dependencies { compile fileTree(include: ['*.jar'],dir: 'libs') compile 'com.android.support:design:26.0.1' compile 'com.android.support:appcompat-v7:26.0.1' compile 'com.android.support:recyclerview-v7:26.0.1' compile ('com.facebook.android:facebook-android-sdk:4.+') { //Tryin to exlude the conflicting lib... exclude group: 'com.android.support',module: 'animated-vector-drawable' } compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { transitive = true; } }
冲突:
All com.android.support libraries must use the exact sasme version
specification (mixing versions can lead to runtime crashes). Found
versions 27.0.1,26.0.1. Examples includes
com.android.support:animated-vector-drawable:27.0.1 and com
android.support:design:26.0.1
如果我删除了facebook导入,冲突就消失了,所以我的问题是如何从facebook的lib中排除动画矢量绘图?
您可以看到我在gradle文件中的尝试但现在已经成功了.
提前致谢.
解决方法
+--- com.android.support:design:26.0.1 | +--- com.android.support:support-v4:26.0.1 -> 27.0.1 | | +--- com.android.support:support-compat:27.0.1 | | | +--- com.android.support:support-annotations:27.0.1 | | | \--- android.arch.lifecycle:runtime:1.0.0 | | | +--- android.arch.lifecycle:common:1.0.0 | | | \--- android.arch.core:common:1.0.0 | | +--- com.android.support:support-media-compat:27.0.1 | | | +--- com.android.support:support-annotations:27.0.1 | | | \--- com.android.support:support-compat:27.0.1 (*) | | +--- com.android.support:support-core-utils:27.0.1 | | | +--- com.android.support:support-annotations:27.0.1 | | | \--- com.android.support:support-compat:27.0.1 (*) | | +--- com.android.support:support-core-ui:27.0.1 | | | +--- com.android.support:support-annotations:27.0.1 | | | \--- com.android.support:support-compat:27.0.1 (*) | | \--- com.android.support:support-fragment:27.0.1 | | +--- com.android.support:support-compat:27.0.1 (*) | | +--- com.android.support:support-core-ui:27.0.1 (*) | | +--- com.android.support:support-core-utils:27.0.1 (*) | | \--- com.android.support:support-annotations:27.0.1 | +--- com.android.support:appcompat-v7:26.0.1 -> 27.0.1 | | +--- com.android.support:support-annotations:27.0.1 | | +--- com.android.support:support-core-utils:27.0.1 (*) | | +--- com.android.support:support-fragment:27.0.1 (*) | | +--- com.android.support:support-vector-drawable:27.0.1 | | | +--- com.android.support:support-annotations:27.0.1 | | | \--- com.android.support:support-compat:27.0.1 (*) | | \--- com.android.support:animated-vector-drawable:27.0.1 | | +--- com.android.support:support-vector-drawable:27.0.1 (*) | | \--- com.android.support:support-core-ui:27.0.1 (*) | +--- com.android.support:recyclerview-v7:26.0.1 | | +--- com.android.support:support-annotations:26.0.1 -> 27.0.1 | | +--- com.android.support:support-compat:26.0.1 -> 27.0.1 (*) | | \--- com.android.support:support-core-ui:26.0.1 -> 27.0.1 (*) | \--- com.android.support:transition:26.0.1 | +--- com.android.support:support-annotations:26.0.1 -> 27.0.1 | \--- com.android.support:support-v4:26.0.1 -> 27.0.1 (*) +--- com.android.support:appcompat-v7:26.0.1 -> 27.0.1 (*) +--- com.android.support:recyclerview-v7:26.0.1 (*) +--- com.facebook.android:facebook-android-sdk:4.+ -> 4.29.0 | +--- com.facebook.android:facebook-core:4.29.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 | | +--- com.android.support:support-annotations:27.0.1 | | \--- com.android.support:support-core-utils:27.0.1 (*) | +--- com.facebook.android:facebook-common:4.29.0 | | +--- com.facebook.android:facebook-core:4.29.0 (*) | | +--- com.android.support:appcompat-v7:27.0.1 (*) | | +--- com.android.support:cardview-v7:27.0.1 | | | \--- com.android.support:support-annotations:27.0.1 | | +--- com.android.support:customtabs:27.0.1 | | | +--- com.android.support:support-compat:27.0.1 (*) | | | \--- com.android.support:support-annotations:27.0.1 | | +--- com.android.support:support-v4:27.0.1 (*) | | \--- com.google.zxing:core:3.3.0 | +--- com.facebook.android:facebook-login:4.29.0 | | +--- com.facebook.android:facebook-core:4.29.0 (*) | | \--- com.facebook.android:facebook-common:4.29.0 (*) | +--- com.facebook.android:facebook-share:4.29.0 | | +--- com.facebook.android:facebook-core:4.29.0 (*) | | \--- com.facebook.android:facebook-common:4.29.0 (*) | +--- com.facebook.android:facebook-places:4.29.0 | | \--- com.facebook.android:facebook-core:4.29.0 (*) | +--- com.facebook.android:facebook-applinks:4.29.0 | | \--- com.facebook.android:facebook-core:4.29.0 (*) | \--- com.facebook.android:facebook-messenger:4.29.0 | \--- com.facebook.android:facebook-core:4.29.0 (*) \--- com.crashlytics.sdk.android:crashlytics:2.6.8 +--- com.crashlytics.sdk.android:beta:1.2.5 | \--- io.fabric.sdk.android:fabric:1.3.17 +--- io.fabric.sdk.android:fabric:1.3.17 +--- com.crashlytics.sdk.android:crashlytics-core:2.3.17 | +--- io.fabric.sdk.android:fabric:1.3.17 | \--- com.crashlytics.sdk.android:answers:1.3.13 | \--- io.fabric.sdk.android:fabric:1.3.17 \--- com.crashlytics.sdk.android:answers:1.3.13 (*)
通过com.android.support搜索,您可以看到有许多地方使用它与2版本27.0.1和26.0.1.这就是你有警告的原因.要解决这个问题
第一种方式:让你的app只使用26.0.1排除所有com.android.support … 27.0.1的facebook喜欢
compile ('com.facebook.android:facebook-android-sdk:4.+') { exclude group:'com.android.support',module:'support-annotations' exclude group:'com.android.support',module:'support-core-utils' exclude group:'com.android.support',module:'appcompat-v7' exclude group:'com.android.support',module:'customtabs' exclude group:'com.android.support',module:'support-v4' exclude group: 'com.android.support',module:'cardview-v7' }
排除工作但有问题:缺少cardview-v7和customtabs(因为目前没有库提供cardview-v7和customtabs).所以你需要编译
compile 'com.android.support:cardview-v7:26.0.1' compile 'com.android.support:customtabs:26.0.1'
第二种方式:让你的app只使用27.0.1
>将compileSdkVersion从26升级到27
>将以下所有编译从26.0.1更新到27.0.1
编译’com.android.support:design:26.0.1′
编译’com.android.support:appcompat-v7:26.0.1′
编译’com.android.support:recyclerview-v7:26.0.1′