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 吧,不能慌哦