关于Manifest merger failed

时间:2025-02-08 20:36:55

我们在用Android studio在编译的过程中,有时候会遇到这样的error,但是,在日志中是提示给我们如何操作的了,如下:

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

> Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from :7:9-43
is also present at [Testone:AutoScrollViewPagerlibrary:unspecified] :13:9-45 value=(@drawable/ic_launcher)

Suggestion: add 'tools:replace="android:icon"' to <application> element at :5:5-19:19 to override

但是具体该如何操作呢??好吧,我们写个小例子吧,上面也说了实在中去添加

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:andro
    xmlns:tools="/tools"
    package="" >

    <uses-permission android:name=""/>
    <application
        tools:replace="android:icon"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="" />

                <category android:name="" />
            </intent-filter>
        </activity>
    </application>

</manifest>