Android X:工具:替换 在行:中指定属性,但没有指定新值
2022-08-31 12:28:37
我已经在这个网站上尝试了许多解决方案,但仍然,问题没有解决。该问题是由于Android X库引起的。当我添加Android X时,此问题已得到解决,但它打开了新问题。如何解决此问题?
早些时候,此错误即将出现:
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 <application> element at AndroidManifest.xml:19:5-142:19 to override.
添加后,此错误出现:tools:replace="android:appComponentFactory"
java.lang.RuntimeException: Manifest merger failed with multiple errors, see logs
at com.android.builder.core.AndroidBuilder.mergeManifestsForApplication(AndroidBuilder.java:540)
at com.android.build.gradle.tasks.MergeManifests.doFullTaskAction(MergeManifests.java:173)
合并错误(在 Android 清单中):
错误:工具:替换在属性 android:appComponentFactory 的 line:2 中指定的,但没有指定新值的应用程序主清单(此文件),第 1 行
清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.example"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:replace="allowBackup, android:appComponentFactory"
android:allowBackup="false">
...
<application
android:name="com.example"
android:icon="@mipmap/icon"
android:debuggable="true"
android:hardwareAccelerated="false"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:allowBackup="false"
tools:ignore="GoogleAppIndexingWarning,HardcodedDebugMode">
...