尝试将AndroidX迁移到Android AppCompat

时间:2019-03-04 04:00:22

标签: android android-manifest androidx

从AndroidX迁移到Appcompat时出现错误。这是日志构建:

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.

1 个答案:

答案 0 :(得分:2)

因此您想从androidX迁移回支持。如果是这种情况,请从build.gradle的libs下面删除,然后添加旧的支持库。

androidx.core:core:1.0.1

并在gradle.properties文件中删除以下两个属性。

android.useAndroidX=true

android.enableJetifier=true

或者,如果要迁移到Androidx,则将这两个属性添加到gradle.properties文件中。

android.useAndroidX=true

android.enableJetifier=true
相关问题