Manifest merger failed with multiple errors, see logs章

问题:

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 element at AndroidManifest.xml:24:5 to override

Error:Execution failed for task ‘:XXXX:processDebugManifest’.

> Manifest merger failed with multiple errors, see logs

原因:

AS的Gradle插件默认会启用Manifest Merger Tool,若Library项目中也定义了与主项目相同的属性(例如默认生成的android:icon和android:theme),则此时会合并失败,并报上面的错误。

解决方法:

在报错的Module里面的《application》标签添加

manifest  标签添加:xmlns:tools="http://schemas.android.com/tools" 

application 标签添加: tools:replace="label,icon,theme"    // 注意看错误提示,提示哪个就添加哪个(这里是添加不是替换其他的,其他的不要改动)

你可能感兴趣的:(Manifest merger failed with multiple errors, see logs章)