Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app....

场景

添加了一个控件的最新依赖版本后报错

问题描述

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.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:5:5-19:19 to override.

报错原因

引入依赖的控件的最新版本已经引入了androidx,而本地没有更新适配

解决方法

如报错信息中提示那般,在AndroidManifest.xml的Application结点下新增以下两行即可:

android:appComponentFactory=""
tools:replace="android:appComponentFactory"

你可能感兴趣的:(Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app....)