Search code examples
androidfirebasefirebaseui

android manifest merger failed after adding Firebase UI to my dependency


I have upgraded to android studio canary and trying to add firebase UI to my app but am getting the following error:

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.

It seems to be some dependency problem but cant figure it out yet. My gradle file is as follow

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'

I have been advised to get the same version for

compileSdkVersion 26

and

buildToolsVersion "26.0.1"

but still get the same error. What might be causing this ?


Solution

  • You are using an old version of firebaseui that is not compatible with version 12.0.1 of firebase, to solve this:

    Change the following:

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

    to this:

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

    more info here:

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