尝试将AndroidX迁移到Android AppCompat [英] Try to migrate AndroidX to Android AppCompat

查看:74
本文介绍了尝试将AndroidX迁移到Android AppCompat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

推荐答案

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

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

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

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

android.useAndroidX=true

android.enableJetifier=true

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

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

android.useAndroidX=true

android.enableJetifier=true

这篇关于尝试将AndroidX迁移到Android AppCompat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆