本文介绍了Android Studio Gradle 图标错误,清单合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直看到这条消息,但不知道如何彻底解决它.

I keep seeing this message and not sure how to solve it for good.

Error:(43, 9) Attribute application@icon value=(@drawable/new_app_icon) from AndroidManifest.xml:43:9
    is also present at com.github.erizet.signala:signala-longpolling:0.20:7:18 value=(@drawable/ic_launcher)
    Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:40:5 to override
:OpenBook:processDebugManifest FAILED
Error:Execution failed for task ':OpenBook:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs

即使使用我的图标,也尝试将 android:replace="android:icon" 添加到我的清单中.

Tried adding android:replace="android:icon" to my manifest even with my icon.

我尝试从库中删除 android:icon="@drawable/ic_launcher 但它在我构建时不断返回,因为它是从 maven 导入的

I tried deleting the android:icon="@drawable/ic_launcher from the library but it keeps coming back when i build because its imported from maven

有什么想法吗?

推荐答案

看来是gradle的mainfest Merger工具的错.

It seems to be the fault of the mainfest Merger tool for gradle.

http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger

通过添加到我的清单标签解决它 xmlns:tools="http://schemas.android.com/tools"

Solved it by adding to my manifest tag xmlns:tools="http://schemas.android.com/tools"

然后在应用标签中添加tools:replace="android:icon,android:theme"

这告诉合并使用我的清单图标和主题,而不是其他库

This tells the merger to use my manifest icon and theme and not of other libraries

希望能帮到你谢谢

这篇关于Android Studio Gradle 图标错误,清单合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 01:06