8

I have errors when migrate from AndroidX to Appcompat. Here is log build:

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 <application> element at AndroidManifest.xml:18:5-138:19 to override.
Zoe
  • 27,060
  • 21
  • 118
  • 148
  • Check minimum required gradle version for AndroidX migration. If that is fine then add tools:replace="android:appComponentFactory" to application tag. – Pankaj Kumar Mar 04 '19 at 04:09
  • This error will go if you apply my anwser. – Hussnain Haidar Mar 04 '19 at 05:40
  • Possible duplicate of [Manifest Merger fails for appComponentFactory](https://stackoverflow.com/questions/52135251/manifest-merger-fails-for-appcomponentfactory) – Zoe Mar 06 '19 at 12:22

1 Answers1

4

So you want to migrate back to support from androidX. If that will be the case the remove below libs from build.gradle and add old support library instead.

androidx.core:core:1.0.1

And also remove below two properties in gradle.properties files.

android.useAndroidX=true

android.enableJetifier=true

Or if you want to migrate to Androidx then add these two properties to gradle.properties file.

android.useAndroidX=true

android.enableJetifier=true
Hussnain Haidar
  • 2,200
  • 19
  • 30