Try to migrate AndroidX to Android AppCompat

China☆狼群 提交于 2021-02-07 12:42:41

问题


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.

回答1:


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


来源:https://stackoverflow.com/questions/54976440/try-to-migrate-androidx-to-android-appcompat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!