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?
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.
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.
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.
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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With