android - 尝试将 AndroidX 迁移到 Android AppCompat
问题描述
从 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.
解决方案
因此,您想从 androidX 迁移回支持。如果是这种情况,请从 build.gradle 中删除以下库并添加旧的支持库。
androidx.core:core:1.0.1
并且还删除 gradle.properties 文件中的以下两个属性。
android.useAndroidX=true
android.enableJetifier=true
或者,如果您想迁移到 Androidx,则将这两个属性添加到 gradle.properties 文件中。
android.useAndroidX=true
android.enableJetifier=true
推荐阅读
- asp.net-core - NetCore:如何管理从主应用程序到子域的请求?
- typescript - 在 vue3 中使用来自 headless ui 的 Modal
- google-apps-script - Google Apps 脚本编辑器 - 是否可以详细说明错误?
- java - 如何在java中获得直接键盘输入
- java - intellij idea buddy 插件 spring data jpa + rest 存储库
- java - 在 SharedPreferences 中保存模型类对象
- php - 如何有条件地验证 Laravel 5 中的请求字段?
- postgresql - PostgreSql - 从日期中提取月份+年份
- node.js - req.flash() 结果 [ ]
- typescript - 使用 jsPlumb 和 @jsplumb/browser-ui 与第三方库时,Angular SSR 中获取文档未定义错误