1

I'm beginner in android and get this error when try to build project:

Manifest merger failed with multiple errors, see logs


read some answer in stack over flow but can not solve my problem,my gradle is this:

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.example.behineh.seaapp"
        minSdkVersion 14
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}


and this is my manifest file:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.behineh.seaapp">
      <application
        android:allowBackup="true"
        tools:replace="android:allowBackup"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="false"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:screenOrientation="portrait"></activity>
        <activity android:name=".LoginActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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


how can i solve problem?thanks all.
my full error log:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
Amir2511
  • 37
  • 7

1 Answers1

0

Your APK file can contain just one AndroidManifest.xml file, but your Android Studio project may contain several—provided by the main source set, build variants, and imported libraries. So when building your app, the Gradle build merges all manifest files into a single manifest file

You can merge manifest like this

<application
    tools:node="merge"
    tools:replace="android:label, android:icon, android:theme, 
    android:allowBackup">

</application>

Check android developer documentation for further detail

https://developer.android.com/studio/build/manifest-merge.html

Fazal Hussain
  • 1,129
  • 12
  • 28