清单合并失败,出现多个错误,错误:工具:替换指定,但没有指定应用主清单的新值



我在添加 firebase 依赖项时遇到清单合并失败并出现多个错误

我尝试添加tools:replace标签,这就是增加错误的原因。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.ecommerce"
    xmlns:tools="http://schemas.android.com/tools"
    >
    <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="android:allowBackup,icon,theme,label,name">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

如果您有任何尚未迁移到 AndroidX 命名空间的 Maven 依赖项,当您在 gradle.properties 文件中将以下两个标志设置为 true 时,Android Studio 构建系统也会为您迁移这些依赖项:

android.useAndroidX=true
android.enableJetifier=true

欲了解更多信息,请单击此处

最新更新