属性 application@label 也存在于

问题描述 投票:0回答:3

在我的 android 项目中安装新库后,出现以下错误:

/android/app/src/debug/AndroidManifest.xml Error:
    Attribute application@label value=(Compassion) from (unknown)
    is also present at [com.github.master] AndroidManifest.xml:15:9-41 value=(@string/app_name).
    Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:6:4-36:19 to override.

FAILURE: Build failed with an exception.
android flutter kotlin android-manifest
3个回答
5
投票

经过一番研究,我发现新安装的库也有一个

application@label
属性,所以你所要做的就是修改你的
AndroidManifest.xml
文件,添加以下两行代码:

  1. xmlns:tools="http://schemas.android.com/tools"
    添加到清单标签
<manifest
    xmlns:tools="http://schemas.android.com/tools">
...
  1. tools:replace="android:label"
    添加到应用程序标签
...
   <application
        tools:replace="android:label">

3
投票

转到主 AndroidManifest.xml 并粘贴下面这两行

在清单标签中

xmlns:tools="http://schemas.android.com/tools"

并在应用程序标签中

tools:replace="android:label"

这对我有用


0
投票

您可以在 Manifest 应用程序标签中添加此行

tools:replace="android:name"

如果您使用的是 androidx,请在 gradle 属性中使用此行

android.enableJetifier=true
© www.soinside.com 2019 - 2024. All rights reserved.