Manifest Merger Failed:Attribute Application@Appcomponentfactory Cant Solve This

Manifest merger failed : Attribute application@appComponentFactory cant solve this

You are using

implementation 'com.google.firebase:firebase-messaging:19.0.1'

Firebase migrated to AndroidX in the latest release.
It means that you are using both, support libraries and androidx libraries.

You can:

  • migrate to androidx as described below
  • downgrade your firebase dependencies (but it is not a real solution because you have to migrate sooner or later)

You can check the official release notes:

Warning: This release is a MAJOR version update and breaking change.
The latest update to Google Play services and Firebase includes the following changes:

Migration from Android Support Libraries to Jetpack (AndroidX) Libraries. Libraries will not work unless you make the following changes in your app:

  • Upgrade com.android.tools.build:gradle to v3.2.1 or later.
  • Upgrade compileSdkVersion to 28 or later.
  • Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.

Manifest merger failed : Attribute application@appComponentFactory - Androidx

After hours of struggling, I solved it by including the following within app/build.gradle:

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

Put these flags in your gradle.properties

android.enableJetifier=true
android.useAndroidX=true

Changes in build.gradle:

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha04'

Refer to: https://developer.android.com/jetpack/androidx/migrate

Manifest merger failed: Attribute application@appComponentFactory

the date-picker has androidx as a dependency. downgrading to version 3.6.4 would make it depend on android.support again - or upgrade your app to use androidx. see issue 543.

// https://mvnrepository.com/artifact/com.wdullaer/materialdatetimepicker
implementation "com.wdullaer:materialdatetimepicker:3.6.4"

^ this would be the most easy way to fix the conflicting dependencies.

Manifest merger failed : Attribute application@appComponentFactory after add Exoplayer 2.10.5


Manifest merger failed : Attribute application@appComponentFactory
value=(android.support.v4.app.CoreComponentFactory) from
[com.android.support:support-compat:28.0.0]
AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86
value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:25:5-171:19 to override.

My Suggestion is - Move to AndroidX. You can migrate an existing project to AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.

Upgrade to

 classpath 'com.android.tools.build:gradle:3.6.1'//3.6.3

Your dependencies will

 implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'


Related Topics



Leave a reply



Submit