Saturday, November 28, 2015

Android Fixing Manifest Error - manifest merger failure


When included a new Android Library module, got the conflict below. This happens when the Manifest merge fails between the module and the Application.

Error:(10, 9) Attribute application@label value=(IoT League) from AndroidManifest.xml:10:9
Error:(10, 9) Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@label value=(MyTestApp) from AndroidManifest.xml:10:9
  is also present at MyTestApp2:mytestlib:unspecified:13:9 value=(@string/app_name)
  Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:7:5 to override

To solve it, below can be added in the application manifest 

"http://schemas.android.com/apk/res/android"
package=“com.testapp” xmlns:tools="http://schemas.android.com/tools"

android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label=“MyTestApp2”
android:theme="@style/AppTheme"
tools:replace="android:label" 


References:

1 comment:

  1. Check my vedio solving [Error: Manifest merger failed with multiple errors] https://youtu.be/b7tDIgmHsQY

    ReplyDelete