I wanted to use Firebase UI Auth in my android app but when I add the dependency, the gradle shows an error

Viewed 578

Error:Execution failed for task ':app:processDebugManifest'.

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

These are my dependencies:

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.google.firebase:firebase-database:11.0.4'
    implementation 'com.google.firebase:firebase-auth:11.0.4'
    compile 'com.firebaseui:firebase-ui:2.2.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
}
3 Answers

Change your FirebaseUI Version as shown below.

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

add

'com.android.support:design-v7:26.1.0'

Check the official doc:

If you would like to use a newer version of one of FirebaseUI's transitive dependencies, such as Firebase, Play services, or the Android support libraries, you need to add explicit compile declarations in your build.gradle for all of FirebaseUI's dependencies at the version you want to use.

For example if you want to use Play services/Firebase version FOO and support libraries version BAR add the following extra lines for each FirebaseUI module you're using:

Auth:

compile "com.google.firebase:firebase-auth:$FOO"
compile "com.google.android.gms:play-services-auth:$FOO"

compile "com.android.support:design:$BAR"
compile "com.android.support:customtabs:$BAR"
compile "com.android.support:cardview-v7:$BAR"

Database:

compile "com.google.firebase:firebase-database:$FOO"

compile "com.android.support:recyclerview-v7:$BAR"
compile "com.android.support:support-v4:$BAR"

Storage:

compile "com.google.firebase:firebase-storage:$FOO"

compile "com.android.support:appcompat-v7:$BAR"
compile "com.android.support:palette-v7:$BAR"

In your case you have to add to your build.gradle:

compile "com.android.support:design:26.1.0."
compile "com.android.support:customtabs:26.1.0."
compile "com.android.support:cardview-v7:26.1.0."
compile "com.android.support:recyclerview-v7:26.1.0."
compile "com.android.support:support-v4:26.1.0."
compile "com.android.support:appcompat-v7:26.1.0."
compile "com.android.support:palette-v7:26.1.0."
Related