Android Studio Gradle Icon Error, Manifest Merger

Android studio Gradle icon error, Manifest Merger

It seems to be the fault of the mainfest Merger tool for gradle.

http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger

Solved it by adding to my manifest tag xmlns:tools="http://schemas.android.com/tools"

Then added tools:replace="android:icon,android:theme" to the application tag

This tells the merger to use my manifest icon and theme and not of other libraries

Manifest merger failed error in Android gradle

It because you are using a different library for android. Made refactor to AndroidX packages for all library

With this

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

// additional libraries
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0-alpha1'
implementation 'androidx.room:room-runtime:2.1.0-alpha03'
annotationProcessor "androidx.room:room-compiler:2.1.0-alpha03"
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'

to this

//Android support libraries.
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'

implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'

As of Support Library and AndroidX Library are diffrent one. So use only one type of library.

Manifest Merger Failed.

Just add following in tag of manifest file:

<application
android:name=".MainApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
tools:replace="android:icon">

ERROR: Manifest merger failed : Attribute application@appComponentFactory

Find a solution by adding googlePlayServicesVersion = "16.+" to app/build.gradle, since Google Services has been updated :

buildscript {
ext {
...
googlePlayServicesVersion = "16.+"
}
...
}

Flutter When running app on Android a Manifest Merger failed error: different values is found

I was able to recreate your problem it seems that you need to sync your package name across multiple AndroidManifest.xml files.

Sample Image

Try to update this 3 AndroidManifest.xml files:

Sample Image



Related Topics



Leave a reply



Submit