android 将 Firebase UI 添加到我的依赖项后清单合并失败

android manifest merger failed after adding Firebase UI to my dependency

我已升级到 android studio canary 并尝试将 firebase UI 添加到我的应用程序,但出现以下错误:

Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.1) from [com.android.support:customtabs:26.0.1] AndroidManifest.xml:25:13-35
    is also present at [com.android.support:design:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:23:9-25:38 to override.

这似乎是一些依赖性问题,但还不能解决。我的 gradle 文件如下

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.rainbow.dili"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.google.firebase:firebase-database:12.0.1'
    compile 'com.google.firebase:firebase-storage:12.0.1'
    compile 'com.firebaseui:firebase-ui:2.3.0'
    compile 'com.tbuonomo.andrui:viewpagerdotsindicator:1.0.1'
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support.constraint:constraint-layout:1.1.0-beta6'
    compile 'com.droidninja:filepicker:2.0.7'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'me.relex:circleindicator:1.2.2@aar'
    compile 'jp.wasabeef:picasso-transformations:2.1.0'
    compile 'com.android.support:support-vector-drawable:26.1.0'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

有人建议我为

获取相同的版本
compileSdkVersion 26

buildToolsVersion "26.0.1"

但仍然出现同样的错误。可能是什么原因造成的?

您正在使用与 firebase 12.0.1 版本不兼容的旧版本 firebaseui,解决此问题:

更改以下内容:

 compile 'com.firebaseui:firebase-ui:2.3.0'

对此:

compile 'com.firebaseui:firebase-ui:3.3.0'

更多信息在这里:

https://github.com/firebase/FirebaseUI-Android#compatibility-with-firebase--google-play-services-libraries