android
build_error
ai_generated
true
清单合并失败:AndroidManifest.xml:2:5-36 中的属性 application@icon 值=(@mipmap/ic_launcher) 也出现在 AndroidManifest.xml:8:5-41
Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:2:5-36 is also present at AndroidManifest.xml:8:5-41
ID: android/manifest-merger-failed-attribute-applicationicon
90%修复率
86%置信度
1证据数
2024-04-12首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| AGP 7.0+ | active | — | — | — |
| Android Studio 2022.1+ | active | — | — | — |
根因分析
同一属性(例如 android:icon)在多个合并的清单文件中定义且值冲突,导致合并冲突。
English
The same attribute (e.g., android:icon) is defined in multiple merged manifest files with conflicting values, causing a merge conflict.
官方文档
https://developer.android.com/studio/build/manifest-merge解决方案
-
在主清单的 <application> 标签中添加 tools:replace="android:icon" 以覆盖库的值
-
使用 tools:node="merge" 配合 tools:replace 处理多个冲突属性
-
添加 tools:remove 以排除来自库清单的冲突属性
无效尝试
常见但无效的做法:
-
40% 失败
Removing may cause missing icon if it's required; better to use tools:replace to override.
-
50% 失败
If the manifests come from libraries, you may not have direct control over them.
-
60% 失败
tools:remove deletes the attribute entirely, which may not be desired.