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名字不然也會報錯

  • 保存重新編譯就👌了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM