#在導入某些library之後在application添加lable會報錯
Error:(52, 9) Attribute application@label value=(@string/app_name_wear) from AndroidManifest.xml:52:9
is also present at CavyTech:percent-support-extends:1.1.1:13:9 value=(@string/app_name)
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:48:5 to override
:wear2:processDebugManifest FAILED
本人是在導入opencamera之後 直接報錯,此時如果去掉application中的lable 此時APP名稱就是opencamera。
#解決方法
<application
tools:replace="android:label"
xmlns:tools="http://schemas.android.com/tools"
之後再添加 android:label="@string/app_name" 就OK了
同樣可以解決icon theme等問題
#原理
AS的Gradle插件默認會啓用Manifest Merger Tool,若Library項目中也定義了與主項目相同的屬性(例如默認生成的android:icon和android:theme),則此時會合並失敗,並報上面的錯誤。
掃碼關注公衆號“偉大程序猿的誕生“,更多幹貨新鮮文章等着你~
公衆號回覆“資料獲取”,獲取更多幹貨哦~
有問題添加本人微信號“fenghuokeji996” 或掃描博客導航欄本人二維碼