java - 清单合并失败。该怎么办?
问题描述
试图在模拟器上运行应用程序,但有一个错误,它说:
清单合并失败:来自 [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 的属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) 也存在于[androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory)。建议:将 'tools:replace="android:appComponentFactory"' 添加到 AndroidManifest.xml:6:5-24:19 的元素以覆盖。
我看过很多同样的问题,但没有找到我的问题的答案。
我的 AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.cubehelppp">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="allowBackup, label">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我从合并清单中得到了这些错误:
Merging Errors:
Error: Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from AndroidManifest.xml:22:18-86 is also present at AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:6:5-24:19 to override. app main manifest (this file), line 21
该怎么办?(帖子更新到一个新问题)
解决方案
You can try migrating your project to AndroidX. To migrate, Refactor > Migrate to AndroidX
推荐阅读
- jquery - 重定向到具有多个参数的另一个视图,位于不同的控制器 jquery
- android - 尝试显示 50 标记时,Google 地图滚动缓慢且手机应用显示 ANR
- neo4j - 如何在 Neo4j Desktop 中重命名新项目?
- jmeter - 如何在jmeter中传递动态cookie?
- keras - 如何将 pytorch lstmcell 转换为 keras lstm 或 lstmcell
- image - 如何在 konvajs 中自由绘制形状
- python - Python doctest 不在名为 signal.py 的文件上运行
- vue.js - 步进面板之间的自定义过渡效果
- go - 切片容量
- python - 如何区分两种颜色?