Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何解决Android Studio中的清单合并失败?_Java_Eclipse_Android Studio_Android Gradle Plugin_Android Manifest - Fatal编程技术网

Java 如何解决Android Studio中的清单合并失败?

Java 如何解决Android Studio中的清单合并失败?,java,eclipse,android-studio,android-gradle-plugin,android-manifest,Java,Eclipse,Android Studio,Android Gradle Plugin,Android Manifest,首先对我的英语感到抱歉。但我试图理解我的问题。 我将我的eclipse项目导入android studio,在同步Gradle之后,它会显示这个错误 Error:Execution failed for task ':eWatheqOCRLib:processDebugAndroidTestManifest'.> java.lang.RuntimeException: Manifest merger failed : Attribute application@icon value=(@d

首先对我的英语感到抱歉。但我试图理解我的问题。 我将我的eclipse项目导入android studio,在同步Gradle之后,它会显示这个错误

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.
这是我的舱单

<?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>


请帮助我,以便我可以继续。

您的模块中存在明显的合并冲突,而不是在主项目中

从错误日志中可以看出,当
eWatheqOCRLib
中看起来像清单的内容与
eWatheqOCRLib
清单中的
图标
元素冲突时,冲突发生在
eWatheqOCRLib
模块中

添加行:

tools:replace="android:icon"

将工具:replace=“android:icon”放入eWatechorlib并从主项目日志中删除工具:replace=“android:icon”后,将显示此错误。错误:任务“”的执行失败。外部:合并调试资源。“>某些文件处理失败,有关详细信息,请参阅日志是否替换主项目中的图标?如果是这样,你也需要它。但这听起来像是一个不同的问题-可能与你的gradle插件版本有关。我解决了上面的错误,但在清理之后,重新构建android studio,重新启动这些我面临的错误。请帮助我AAPT err(1306681976的Facade):C:\Users\Khan\Downloads\Work\eWatheq.external\res\drawable xxhdpi\splash_screen.png:libpng警告:iCCP:无法识别已编辑的已知sRGB配置文件失败:生成失败,出现异常。*错误:任务“:eWatheq.external:mergeDebugResources”的执行失败。“>某些文件处理失败,请参阅日志了解详细信息*Try:Run with--stacktrace选项以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。这是另一个问题-您可能需要使用不同版本的gradle插件(我使用1.2.3,因为我遇到了类似的问题)。您可能还有一个Eclipse没有注意到的无效PNG(我也有这个问题)。您可能希望将此作为一个单独的问题发布,但如果有机会,请将此答案标记为正确。
tools:replace="android:icon"