android manifest merger failed, gms play services / firebase

前端 未结 8 793
南笙
南笙 2020-12-14 02:03

I am trying to add firebase to my app using the firebaseUI. As the documentations says, I have used the corresponding gms:play-services (11.0.4) with the firebaseUI version

相关标签:
8条回答
  • 2020-12-14 02:10

    It's happening because two versions of support libraries are clashing. On top, you have declared

    buildToolsVersion "26.0.1"
    

    and in dependencies, the version is 26.0.0

    compile 'com.android.support:design:26.0.0'
    

    Just change the support library version to 26.0.1 and it will work fine. I did the same, worked flawlessly in my case.

    0 讨论(0)
  • 2020-12-14 02:19

    add this line to your manifest

     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"
            tools:replace="android:value" />
    

    exactly as shown inside the "application" tag.

    0 讨论(0)
  • 2020-12-14 02:20

    It occurs when you use different versions of the same library for implementation in the build.gradle of app module. You can solve this by implementing same versions of a library.

    If the problem still persists then add the following code at the end of build.gradle(app module)

    configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
            if (requested.group == 'com.android.support') {
                if (!requested.name.startsWith("multidex")) {
                    details.useVersion '25.3.0'
                }
            }
        }
    }
    
    0 讨论(0)
  • 2020-12-14 02:21

    I solved it by adding this in AndroidManifest.xml within the <application> tag at the very bottom:

    <meta-data 
      tools:node="replace"
      android:name="android.support.VERSION"
      android:value="26.1.0"  // <- The max version you see in the error message. For me it was 26.1.0
    />
    

    Then add these two attributes to the <manifest ... > tag:

    xmlns:tools="http://schemas.android.com/tools"
    tools:node="replace"
    
    0 讨论(0)
  • 2020-12-14 02:26

    This type of error has come up because of different libraries added by you. While adding libraries make sure that all of them are of the same version and work flawlessly with one another.

    0 讨论(0)
  • 2020-12-14 02:31

    I solved the problem by adding:

        configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
            if (requested.group == 'com.android.support') {
                if (!requested.name.startsWith("multidex")) {
                    details.useVersion '26.0.0'
                }
            }
        }
    }
    

    from here.

    The tooltip recommended adding tools:replace="android:value"' to meta-data but this throws another error, so im going with the solution above

    0 讨论(0)
提交回复
热议问题