android
build_error
ai_generated
true
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%Fix Rate
86%Confidence
1Evidence
2024-04-12First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| AGP 7.0+ | active | — | — | — |
| Android Studio 2022.1+ | active | — | — | — |
Root Cause
The same attribute (e.g., android:icon) is defined in multiple merged manifest files with conflicting values, causing a merge conflict.
generic中文
同一属性(例如 android:icon)在多个合并的清单文件中定义且值冲突,导致合并冲突。
Official Documentation
https://developer.android.com/studio/build/manifest-mergeWorkarounds
-
95% success Add tools:replace="android:icon" to the <application> tag in your main manifest to override library values
Add tools:replace="android:icon" to the <application> tag in your main manifest to override library values
-
90% success Use tools:node="merge" with tools:replace to handle multiple conflicting attributes
Use tools:node="merge" with tools:replace to handle multiple conflicting attributes
-
85% success Add tools:remove to exclude a conflicting attribute from a library manifest
Add tools:remove to exclude a conflicting attribute from a library manifest
中文步骤
在主清单的 <application> 标签中添加 tools:replace="android:icon" 以覆盖库的值
使用 tools:node="merge" 配合 tools:replace 处理多个冲突属性
添加 tools:remove 以排除来自库清单的冲突属性
Dead Ends
Common approaches that don't work:
-
40% fail
Removing may cause missing icon if it's required; better to use tools:replace to override.
-
50% fail
If the manifests come from libraries, you may not have direct control over them.
-
60% fail
tools:remove deletes the attribute entirely, which may not be desired.