0

First Sorry about my English. But i try to understand my issue. I import my eclipse project to android studio and after sync the Gradle, its show me this error

Error:Execution failed for task ':eWatheqOCRLib:processDebugAndroidTestManifest'.> java.lang.RuntimeException: Manifest merger failed : Attribute application@icon value=(@drawable/ic_launcher) from [debug] AndroidManifest.xml:46:9-45
    is also present at [Graddle Build ewatheq:eWatheqEyesTwoLib:unspecified] AndroidManifest.xml:32:18-55 value=(@drawable/service_icon).
    Suggestion: add 'tools:replace="android:icon"' to <application> element at manifestMerger6194683839773316547.xml:7:5-9:19 to override.

I google a lot and try many things to fix using these stacks over flow. Android studio Gradle icon error, Manifest Merger https://github.com/coomar2841/image-chooser-library/issues/63 https://github.com/pedant/sweet-alert-dialog/issues/33

This is my build.gradle file

apply plugin: 'com.android.application'


buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
    }
}
repositories {
    mavenCentral()
}

android {
    compileSdkVersion 10
    buildToolsVersion "23.0.2"
    defaultConfig {

        applicationId "ae.ewatheq.external"
        minSdkVersion 10
        targetSdkVersion 22
        versionCode="7"
        versionName="0.0.7.0"
    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile files('libs/activation.jar')
    compile files('libs/converter-gson-2.0.0-beta2.jar')
    compile files('libs/crashlytics.jar')
    compile files('libs/gson-2.2.2.jar')
    compile files('libs/hirondelle-date4j-1.5.1.jar')
    compile files('libs/httpclient-4.3.6.jar')
    compile files('libs/httpcore-4.3.3.jar')
    compile files('libs/httpmime-4.3.6.jar')
    compile files('libs/mail.jar')
    compile files('libs/universal-image-loader-1.9.3.jar')
    compile files('libs/volley.jar')
    compile files('libs/YouTubeAndroidPlayerApi.jar')
    compile project(':eWatheqOCRLib')
    compile project(':eWatheqNineOldLibrary')
    compile project(':eWatheqCalDroidLib')
    compile project(':eWatheqFloatingButtonLib')
    compile project(':eWatheqViewPagerIndicatorlibrary')
}

And this is my Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ae.ewatheq.external"
    xmlns:tools="http://schemas.android.com/tools"
    android:versionCode="7"
    android:versionName="0.0.7.0" >

    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="22" />

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />

    <uses-feature android:name="android.hardware.camera.autofocus" />
    <uses-feature
        android:name="android.hardware.camera.flash"
        android:required="false" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="false" />

    <application

        android:name="ae.ewatheq.app.AppController"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        tools:replace="android:icon">

        <activity
            android:name="ae.ewatheq.SplashActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="image/*" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" >
                </action>

                <category android:name="android.intent.category.DEFAULT" >
                </category>
                <category android:name="android.intent.category.BROWSABLE" >
                </category>

                <data android:mimeType="image/*" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" >
                </action>

                <category android:name="android.intent.category.DEFAULT" >
                </category>
                <category android:name="android.intent.category.BROWSABLE" >
                </category>

                <data
                    android:mimeType="application/pdf"
                    android:scheme="file" >
                </data>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" >
                </action>

                <category android:name="android.intent.category.DEFAULT" >
                </category>
                <category android:name="android.intent.category.BROWSABLE" >
                </category>

                <data
                    android:mimeType="application/pdf"
                    android:scheme="content" >
                </data>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" >
                </action>

                <category android:name="android.intent.category.DEFAULT" >
                </category>
                <category android:name="android.intent.category.BROWSABLE" >
                </category>

                <data
                    android:host="*"
                    android:pathPattern=".*\.[pP][dD][fF]"
                    android:scheme="file" />
            </intent-filter>
        </activity>
        <activity
            android:name="ae.ewatheq.FilesActivity"
            android:label="@string/app_name" />
        <activity
            android:name="ae.ewatheq.HelpActivity"
            android:label="@string/app_name" />
        <activity
            android:name="ae.ewatheq.SignInActivity"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:label="@string/app_name" />
        <activity
            android:name="ae.ewatheq.RegisterActivity"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:label="@string/app_name" />
        <activity
            android:name="ae.ewatheq.MainActivity"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:label="@string/app_name" />
       <!-- <activity
            android:name="com.artifex.mupdflib.MuPDFActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.artifex.mupdflib.PDFPreviewGridActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" />-->
        <activity
            android:name="ewatheq.ocr.lib.HelpActivity"
            android:label="@string/app_name"
            android:screenOrientation="landscape" />
        <activity
            android:name="ewatheq.ocr.lib.OCRActivity"
            android:label="@string/app_name"
            android:screenOrientation="landscape" />
        <activity android:name="com.soundcloud.android.crop.CropImageActivity" />

        <meta-data
            android:name="com.crashlytics.ApiKey"
            android:value="7f09b80a5dde30b3ef46aaf1e3e241777d9ac74a" />
    </application>

</manifest>

Please help me so that i can continue further.

Community
  • 1
  • 1
user3283148
  • 101
  • 4
  • 13

1 Answers1

-1

You have a manifest merger conflict in your module, not in your main project.

From the error logs, the conflict occurs in the eWatheqOCRLib module, when what looks like a manifest in ewatheq:eWatheqEyesTwoLib conflicts with the icon element in the eWatheqOCRLib manifest.

Add the line:

tools:replace="android:icon"

to the manifest in your eWatheqOCRLib module and that should resolve this error.

Jim
  • 10,172
  • 1
  • 27
  • 36
  • After put tools:replace="android:icon" in ewatheOCRLib and remove tool:replace= "android:icon" from main project Log show this error. Error:Execution failed for task ':eWatheq.external:mergeDebugResources'. > Some file crunching failed, see logs for details – user3283148 Dec 27 '15 at 05:37
  • do you replace the icon in the main project? If so, you will need it there also. But that sounds like a different problem - maybe related to your gradle plugin version – Jim Dec 27 '15 at 18:43
  • i resolve above error but after clean, build restart android studio these errors i am facing. please help me AAPT err(Facade for 1306681976):C:\Users\Khan\Downloads\Work\eWatheq.external\res\drawable-xxhdpi\splash_screen.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited FAILURE: Build failed with an exception. * What went wrong: Execution failed for task':eWatheq.external:mergeDebugResources'. > Some file crunching failed, see logs for details * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. – user3283148 Dec 30 '15 at 12:39
  • That's a different issue - you probably need to use a different version of the gradle plugin (I'm using 1.2.3 because I had a similar problem). You may also have an invalid PNG which Eclipse did not notice (I had that problem too). You will want to post this as a separate question, but please mark this answer as correct when you get a chance. – Jim Dec 30 '15 at 15:49