尝试将我自己的徽标添加到android应用程序-android Studio时,清单合并失败

尝试将我自己的徽标添加到android应用程序-android Studio时,清单合并失败,android,android-studio,icons,android-manifest,Android,Android Studio,Icons,Android Manifest,我试图在Android Studio中将我自己的图标添加到我的应用程序中,但失败了。我提出了一个完全相同的问题,但他的回答对我不起作用。我尝试添加了tools:replace=“android:icon”和tools:replace=“android:icon,android:theme”(当然是在两个不同的场合),但没有改变 这就是Android Studio一直给我的错误 Error:(12, 9) Execution failed for task ':app:processDebugMa

我试图在Android Studio中将我自己的图标添加到我的应用程序中,但失败了。我提出了一个完全相同的问题,但他的回答对我不起作用。我尝试添加了
tools:replace=“android:icon”
tools:replace=“android:icon,android:theme”
(当然是在两个不同的场合),但没有改变

这就是Android Studio一直给我的错误

Error:(12, 9) Execution failed for task ':app:processDebugManifest'.

> Manifest merger failed : Attribute application@icon value=(@drawable/footynews_logo_new) from AndroidManifest.xml:12:9
    is also present at com.arasthel:gnavdrawer-library:1.1.4:4:45 value=(@drawable/ic_launcher)
    Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:9:5 to override
Error:(12, 9) Attribute application@icon value=(@drawable/footynews_logo_new) from AndroidManifest.xml:12:9
错误:(12,9)任务执行失败:app:processDebugManifest。
>清单合并失败:属性application@icon值=(@drawable/footynews\u logo\u new)来自AndroidManifest.xml:12:9
也出现在com.arasthel:gnavdrawer库:1.1.4:4:45 value=(@drawable/ic_launcher)
建议:在AndroidManifest.xml:9:5处的元素中添加'tools:replace=“android:icon”'以覆盖
错误:(12,9)属性application@icon值=(@drawable/footynews\u logo\u new)来自AndroidManifest.xml:12:9
编辑:我刚刚发现,尽管我以为该应用程序正在使用我的项目目录中的ic_启动器,但它实际上正在使用我正在使用的一个库中的ic_启动器。如何强制应用程序使用我的启动器图标

tools:replace="android:icon,android:theme"
应该有用。希望你补充说

xmlns:tools="http://schemas.android.com/tools"
如果这不起作用,你有另一个选择。使用旧的清单合并。将其添加到
build.gradle
文件中

android { useOldManifestMerger true }

您可以找到更多信息。

在清单文件中添加两行:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="..."
    xmlns:tools="http://schemas.android.com/tools"> <!--Add this line-->

    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        tools:replace="icon, label"/> <!--Add this line-->
</manifest>

我确实添加了xmlns:tools=“.结果发现我使用的库(GNavDrawer)有一个清单,不知怎的,我的项目被迫使用它的ic_启动器(或者我认为是)。我通过更改清单文件解决了这个问题(尽管我不确定这样做是否正确)”在1.0中,我们删除了调用旧清单合并的功能。。“可能的副本