tools:replace="android:icon, android:theme"
2017-08-17 15:06
531 查看
Error:(26, 9) Attribute application@icon value=(@drawable/logo) from AndroidManifest.xml:26:9
Error:(28, 9) Attribute application@theme value=(@style/ThemeActionBar) from AndroidManifest.xml:28:9
is also present at XXXX-trunk:XXXXLib:unspecified:15:9 value=(@style/AppTheme)
Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:24:5 to override
Error:Execution failed for task ':XXXX:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
'tools:replace="android:theme"
'tools:replace="android:label"
'tools:replace="android:icon"
原因:
AS的Gradle插件默认会启用Manifest Merger Tool,若Library项目中也定义了与主项目相同的属性(例如默认生成的android:icon和android:theme),则此时会合并失败,并报上面的错误。
解决方法有以下2种:
方法1:在Manifest.xml的application标签下添加tools:replace="android:icon, android:theme"(多个属性用,隔开,并且记住在manifest根标签上加入xmlns:tools="http://schemas.android.com/tools",否则会找不到namespace哦)
方法2:在build.gradle根标签上加上useOldManifestMerger true 这方法有的版本不适用
Error:(28, 9) Attribute application@theme value=(@style/ThemeActionBar) from AndroidManifest.xml:28:9
is also present at XXXX-trunk:XXXXLib:unspecified:15:9 value=(@style/AppTheme)
Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:24:5 to override
Error:Execution failed for task ':XXXX:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
'tools:replace="android:theme"
'tools:replace="android:label"
'tools:replace="android:icon"
原因:
AS的Gradle插件默认会启用Manifest Merger Tool,若Library项目中也定义了与主项目相同的属性(例如默认生成的android:icon和android:theme),则此时会合并失败,并报上面的错误。
解决方法有以下2种:
方法1:在Manifest.xml的application标签下添加tools:replace="android:icon, android:theme"(多个属性用,隔开,并且记住在manifest根标签上加入xmlns:tools="http://schemas.android.com/tools",否则会找不到namespace哦)
方法2:在build.gradle根标签上加上useOldManifestMerger true 这方法有的版本不适用
相关文章推荐
- AndroidStudio出现tools:replace="android:theme"问题
- Suggestion: add 'tools:replace="android:icon"' to element
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- AndroidStudio出现tools:replace="android:icon"问题
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- Android Studio Gradle tools:replace="android:icon"错误
- Android Studio uggestion: add 'tools:replace="android:theme" 问题
- AndroidStudio出现tools:replace="android:icon"问题
- tools:replace="android:icon" 的作用和替代方法
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- Studio uggestion: add 'tools:replace="android:theme"
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- [置顶] Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-2
- Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-2
- Suggestion: add 'tools:replace="android:label"'
- AndroidManifest 文件合并错误-->tools:replace="android:value"问题
- add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:34 to over
- Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:28:5
- add 'tools:replace="android:value"' to <meta-data> element问题的解决
- Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:22:5-2