とあるライブラリを組み込んだとき、ライブラリ側のAndroidManifest.xmlでもandroid:themeが指定されているとき次のようなエラーメッセージが出た。
Error:(17, 9) Attribute application@theme value=(@style/HogeHome) from AndroidManifest.xml:17:9
Error:(17, 9) Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@theme value=(@style/AppThemeHome) from AndroidManifest.xml:17:9
is also present at com.fugafuga:1.2.3.4:31:9 value=(@style/FugaSdkTheme)
Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:10:5 to override
android:themeがコンフリクトしているなら、ごもっともなエラーメッセージだと思う。
幸い「Suggestion: add 'tools:replace="android:theme"' to element」と出ているので
言われた通りに'tools:replace="android:theme"'を追加した。
しかし動かない。
なんでかな〜と思ってManifest Mergerのドキュメントを見ていると、'tools:node=”replace”'を見つけた。
'tools:node=”replace”'と'tools:replace="android:theme"'の両方をapplicationに付加したらやっとビルドが通った。