1
votes

My Build is failing with this error - Manifest merger failed with multiple errors, see logs

Merging Errors it shows as -

Error: Missing 'name' key attribute on element meta-data at AndroidManifest.xml:23:9-51 app main manifest (this file), line 22 Error: tools:replace specified at line:23 for attribute android:value, but no new value specified app main manifest (this file), line 22 Error: Validation failed, exiting app main manifest (this file)

AndroidManifest.xml - below is a small segment from the manifest file where it shows the error.

<application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <meta-data tools:replace="android:value"/>
        <activity ....

Build.Gradle file small segment below -

android {
    compileSdkVersion 26
    buildToolsVersion '28.0.3'
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 26
}
        dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        implementation 'com.android.support:appcompat-v7:26.1.0'
        implementation 'com.android.support:design:26.1.0'
        implementation 'com.google.android.gms:play-services-ads:17.1.1'
        implementation 'com.google.android.gms:play-services-analytics:16.0.5'
        testImplementation 'junit:junit:4.12'
    }
2
Checked for any other errors that are not specified?Devealte
This looks like a mistake: <meta-data tools:replace="android:value"/>.TheWanderer
I removed this code <meta-data tools:replace="android:value"/> and it's working now. Don't remember why I added this earlier. Thanks @TheWanderer for pointing it out.Nikhil
update gradle version from 4.2 to 4.6. It will resolve the probleRahul Kushwaha

2 Answers

3
votes

Remove this:

<meta-data tools:replace="android:value"/>

It doesn't seem to be doing anything, and it's the cause of your error.

1
votes

Android Studio 3.2.1

Just add google() in root level in build.gradle

buildscript {
    repositories {
        google() //  <--here
        jcenter()
    }
 }

allprojects {
    repositories {
        google() //  <-- here
        jcenter()
    }
}

Now see the magic - error is gone... :)