Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manifest merger failed when trying to add my own logo to android app - Android Studio

I tried to add my own icon to my app in Android Studio and I encountered a Manifest merger fail. I fount an identical question here but his answer is not working for me. I tried adding tools:replace="android:icon" and tools:replace="android:icon,android:theme" (on 2 separate occasions of course) but no change.

This is the error Android Studio is keep giving me.

Error:(12, 9) Execution failed for task ':app:processDebugManifest'.

> Manifest merger failed : Attribute application@icon value=(@drawable/footynews_logo_new) from AndroidManifest.xml:12:9
    is also present at com.arasthel:gnavdrawer-library:1.1.4:4:45 value=(@drawable/ic_launcher)
    Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:9:5 to override
Error:(12, 9) Attribute application@icon value=(@drawable/footynews_logo_new) from AndroidManifest.xml:12:9

EDIT : I just found out even though I thought the app was using the ic_launcher in my project directory, it is actually using the ic_launcher in one of the libraries I'm using. How do I force the app to use my launcher icon instead?

like image 699
Thahzan Avatar asked Jul 08 '14 06:07

Thahzan


People also ask

How do I fix error manifest merger failed?

The initial process would be to open the manifest application known as the AndroidManifest. xml and then click on the Merged Manifest tab below your edit pane. Following which, Click on the merged manifest option. An Error would be visible at the right column and then one must try to solve the error.

How do I fix manifest merger failed with multiple errors?

The following hack works: Add the xmlns:tools="http://schemas.android.com/tools" line in the manifest tag. Add tools:replace="android:icon,android:theme,android:allowBackup,label,name" in the application tag.

Why manifest XML file is important in Android app development?

Every app project must have an AndroidManifest. xml file (with precisely that name) at the root of the project source set. The manifest file describes essential information about your app to the Android build tools, the Android operating system, and Google Play.


2 Answers

tools:replace="android:icon,android:theme"

should work. Hope you added

xmlns:tools="http://schemas.android.com/tools"

If this is not working you have another option. Use the old manifest merger. Add this in your build.gradle file

android { useOldManifestMerger true }

You can find more information here.

like image 70
San Avatar answered Sep 22 '22 08:09

San


Add two line in manifest file :

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="..."
    xmlns:tools="http://schemas.android.com/tools"> <!--Add this line-->

    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        tools:replace="icon, label"/> <!--Add this line-->
</manifest>
like image 35
Ahmad Aghazadeh Avatar answered Sep 23 '22 08:09

Ahmad Aghazadeh