Attribute application@label value=(xxx) from AndroidManifest.xml:8:16-37 is also present at [com.github.adrielcafe:AndroidAudioConverter:0.0.8] AndroidManifest.xml:11:18-50 value=(@string/app_name)

关于安卓编译错误Attribute application@label value=(xxx) from AndroidManifest.xml:8:16-37 is also present at [com.github.adrielcafe:AndroidAudioConverter:0.0.8] AndroidManifest.xml:11:18-50 value=(@string/app_name).Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:8:3-29:17 to override.
  • 问题的大概意思是在AndroidManifest.xml文件中application的label需要手动设定并覆盖

  • 在项目文件夹中找到android/app/src/main/AndroidManifest.xml文件

image-20211105154038040

  • 找到application标签,如果没有就在manifest标签下新建一个,如下

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="<package name>">
      <application xmlns:tools="http://schemas.android.com/tools" tools:replace="android:label" android:label="app name" 
        android:icon="@mipmap/launcher_icon">
          </application>
    </manifest>
    
  • 其中android:label是你项目中最终展示的名字,android:icon是图标文件,添加的信息为

    xmlns:tools="http://schemas.android.com/tools" 
    tools:replace="android:label" 
    
  • 必须要添加xmlns:tools这一行不然会报错,并且添加过后一定要指定android:label的值作为你的app名字不然也会报错

  • 保存重新编译就👌了

posted @ 2021-11-05 15:50  R1cardo  阅读(868)  评论(0编辑  收藏  举报