Aditya Chawla Aditya Chawla - 2 months ago 42
Android Question

Manifest merger failed with multiple errors

When I try to rebuild project, android studio gives the error:

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


Manifest merger failed with multiple errors, see logs


I tried all solutions provided for similar problems like this one:
Android Gradle Manifest merger failed

Following is my build.gradle:

apply plugin: 'com.android.application'

android {


compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "io.tnine.myapplication"
minSdkVersion 18
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.1+'
compile 'com.android.support:support-v4:23.1.1'
}


Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.tnine.myapplication">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

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

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>


<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />


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

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>

<activity android:name=".fragment_console"></activity>
</application>

</manifest>


What changes should I make?

edit:
project build.gradle:

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Answer

The problem was solved by removing this tag:

 <meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="@string/google_maps_key" />

because I had specified the API key in another tag below. It was not a problem of build.gradle