-1

Problem : 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:appcompat-v7:25.4.0] AndroidManifest.xml:28:13-35 is also present at [com.android.support:customtabs:26.1.0] AndroidManifest.xml:25:13-35 value=(26.1.0).

As per Studio suggestion, added tools:replace="android:value" to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.

it did not work.

AndroidManifest File :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.rahul.my_addmobdemo"
    tools:replace="26.1.0">

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        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>
    </application>

</manifest>

build.gradle File :

    apply plugin: 'com.android.application'

    android {
        compileSdkVersion 25
        buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.example.rahul.my_addmobdemo"
        minSdkVersion 23
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:25.4.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    //noinspection GradleCompatible
    implementation 'com.google.android.gms:play-services-ads:15.0.0'
}
Chandu
  • 13
  • 4
  • Possible duplicate of [Gradle: Execution failed for task ':processDebugManifest'](https://stackoverflow.com/questions/17587751/gradle-execution-failed-for-task-processdebugmanifest) – Ali Jun 23 '18 at 15:52

3 Answers3

0

Your problem are incompatibility beteween versions 25 against 26

Try as follow

...
android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0" //or 26.0.2 if required

    defaultConfig {
        ...
        targetSdkVersion 26
        ...
    }
}
...
dependencies {
   ...
   implementation 'com.android.support:appcompat-v7:26.0.2'
   ...
}
Abner Escócio
  • 2,697
  • 2
  • 17
  • 36
  • Hi Abner, Thanks for immediate response. I tried your suggestion but ended in same error. Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple errors, see logs android { compileSdkVersion 26 buildToolsVersion "26.0.0" defaultConfig { applicationId "com.example.rahul.my_addmobdemo" minSdkVersion 23 targetSdkVersion 26 versionCode 1 versionName "1.0" } dependencies { implementation 'com.android.support:appcompat-v7:26.0.2' } – Chandu Jun 23 '18 at 17:19
0

Override the <application> tag in your manifest like this to correctly enable the tools:replace function

<application
    tools:replace="android:value"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
ci0ccarellia
  • 795
  • 9
  • 26
  • Hi Andrea, Thanks for the fast response.I Tried your solution, still it didnt work. Ended in getting below error. Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple errors, see logs – Chandu Jun 23 '18 at 17:10
0

Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.4.0) from [com.android.support:appcompat-v7:25.4.0] AndroidManifest.xml:28:13-35 is also present at [com.android.support:customtabs:26.1.0] AndroidManifest.xml:25:13-35 value=(26.1.0).

customtabs support library is the Google play services 15 dependency, so you need to add it to your dependencies block. Don't forget to make the same version with your support library:

dependencies {
    ...
    implementation 'com.android.support:appcompat-v7:26.1.0'
    // you can also remove this because it's automatically added
    // by Google play services dependency
    implementation 'com.android.support:customtabs:26.1.0'

    ...
    implementation 'com.google.android.gms:play-services-ads:15.0.0'
}

then remove tools:replace="26.1.0" because you don't need it.

After that, update your compileSdkVersion, buildToolsVersion, targetSdkVersion, and support libraries to use the same version which is version 26.

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96