Error:Execution failed for task ':app:processDebugManifest'
D:\AndroidStudio\workSpace\A666\app\src\main\AndroidManifest.xml:13:9-27 Error:
Attribute application@label value=(溜溜) from AndroidManifest.xml:13:9-27
is also present at [A666:materialwidget:unspecified] AndroidManifest.xml:13:9-41 value=(@string/app_name)
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:9:5-31:19 to override
D:\AndroidStudio\workSpace\A666\app\src\main\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [A666:materialwidget:unspecified] D:\AndroidStudio\workSpace\A666\app\build\intermediates\exploded-aar\A666\materialwidget\unspecified\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.csu.xy.materialwidget" to force usage
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
這個錯誤是我在使用了2個module之后出現的。
由於Gradle插件默認會啟用Manifest Merger Tool,若Library項目中manifest也定義了與主項目相同的屬性(例如默認生成的android:icon和android:theme),則此時會合並失敗,並報上面的錯誤。
解決方法
在Manifest.xml的application標簽下添加tools:replace="android:icon, android:theme"(多個屬性用,隔開,並且記住在manifest根標簽上加入xmlns:tools="http://schemas.android.com/tools",否則會找不到namespace哦)而對於我這次的錯誤是只需要添加tools:replace="android:lable"就可以啦!
事實上logcat 已經教我如何糾正錯誤啦(上方紅色段落)所以碰到錯誤就直接分析logcat 吧,不能慌哦
