在我的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.
经过一番研究,我发现新安装的库也有一个application@label
属性,因此您所要做的就是通过添加以下两行代码来修改您的AndroidManifest.xml
文件:
- 将
xmlns:tools="http://schemas.android.com/tools"
添加到舱单标签
<manifest
xmlns:tools="http://schemas.android.com/tools">
...
- 将
tools:replace="android:label"
添加到应用程序标签
...
<application
tools:replace="android:label">
进入主AndroidManifest.xml并粘贴以下两行
xmlns:tools="http://schemas.android.com/tools"
在Application标签
tools:replace="android:label"
This work for me