一说

前情提示

系统:

1
2
3
4
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.3.0] AndroidManifest.xml:24:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:16:5-40:19 to override.

原因:

项目中或者第三方依赖库中使用了高版本的android x,要么你把项目升级到Android X,要么改用低版本兼容。

不升级使用Android X

1
2
3
4
5
6
7
8
9
问题排查:
尝试在清单文件修改添加,一般是没有效果的
tools:replace="android:appComponentFactory"
在AS - terminal 执行命令
查看日志:
gradlew processDebugManifest --stacktrace
查看依赖:
gradlew :app:dependencies
搜索android x,查看到最新版本的toasty1.5.0使用了android X,我们把toasty改成1.4.2版本即可

在这里插入图片描述

在这里插入图片描述

高版本不一定好,要兼容,要适合的版本