Android 常见错误"Manifest merger failed with multiple errors, see logs"

问题:

Error:Execution failed for task ':greencar:processDebugManifest'.

> Manifest merger failed withmultiple errors, see logs

 

原因:

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

解决办法:

在manifest根标签上加入xmlns:tools="http://schemas.android.com/tools",并在Manifest.xml的application标签下添加tools:replace="icon, label, theme"(多个属性用,隔开,视情况而定,最好照抄)。不能写成tools:replace="android:icon, android:label, android:theme",这样不会报错,但也不能解决错误。

可参考官方方法 http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger

 

如果上面方法还解决不了,请参考:http://blog.csdn.net/Alpha58/article/details/72581914

posted @ 2018-03-15 10:28  施行  阅读(793)  评论(0编辑  收藏  举报