Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 6.0 merger fail

Just updated to the latest version of Android Studio and i get this error in the AndroidManifest file

Manifest merger failed : Attribute application@icon value=(@drawable/project_launcher_icon) from AndroidManifest.xml:48:9 is also present at com.github.anupcowkur:reservoir:1.1.1:6:45 value=(@drawable/ic_launcher) Suggestion: add 'tools:replace="icon"' to element at AndroidManifest.xml:44:5 to override

I tried adding tools:replace="@drawable/ic_drawer" in my manifest but i get this error:

Error:(44, 5) tools:replace specified at line:44 for attribute tools:drawable/ic_drawer, but no new value specified

Any ideas?

like image 367
Arthur Avatar asked Jun 09 '14 02:06

Arthur


5 Answers

Following Android Studio's suggestion and adding the following attribute tools:replace="icon" should allow it to build your app successfully, without resorting to using the old manifest merger (which isn't a very forward-looking solution indeed).

Of course, you'll first have to declare the namespace "tools" in order to use it:

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              package="com.sample.app" >
like image 86
FTH Avatar answered Sep 22 '22 05:09

FTH


You should add tools:replace="icon", just like the error message says.

Additional attributes can be replaced using the syntax tools:replace="icon,name,theme"

like image 40
Stelian Morariu Avatar answered Sep 21 '22 05:09

Stelian Morariu


look here: All markers belong to the Android tools namespace, therefore you must declare the namespace in any AndroidManifest.xml containing at least one marker : xmlns:tools="http://schemas.android.com/tools"

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.tests.flavorlib.app"
**xmlns:tools="http://schemas.android.com/tools"**>

<application
    android:icon="@drawable/icon"
    android:label="@string/app_name"
   **tools:replace=”icon, label”**/>
</manifest>

you should add xlms:tools and tools:replace those two lines in manifest file.

like image 34
john vuong Avatar answered Sep 20 '22 05:09

john vuong


Android Studio 0.6 use the new manifest merger tool. This new merger was introduced in version 0.10 of the plugin. As of 0.11, this tool is used by default by the gradle plugin.

In order to revert to the old manifest merger, please add to your build.gradle the following configuration :

android { useOldManifestMerger true }

like image 36
iStar Avatar answered Sep 22 '22 05:09

iStar


For me this worked. Try adding the code in the main module(project) manifest file:

add xmlns:tools="http://schemas.android.com/tools" in your manifest tag

add tools:replace="android:icon,android:label,android:theme" in your application tag

These will let Android Studio know that the icon, label and theme to be used are from that manifest and not from other projects included.

like image 21
mgm Avatar answered Sep 22 '22 05:09

mgm