Android获取Manifest合并失败使用工具时出错:替换

时间:2017-06-06 05:17:22

标签: android

在我的项目中,只要我使用更多库,我必须使用tools:replace覆盖某些功能,例如supportsRtl,当我添加工具名称空间并使用tools:replace="android:supportsRtl,android:allowBackup"时应用程序标签我收到此错误:

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

清单内容:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="com.myapp.androidapp">

    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:name=".APP"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:theme="@style/AppTheme"
        tools:replace="android:supportsRtl,android:allowBackup">

        <activity android:name=".Ui.ActivityStartUpApplication">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

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

        <activity
            android:name=".Ui.ApplicationRobot.view.ActivityRegisterRobot"
            android:configChanges="screenSize|orientation"/>

        <activity
            android:name=".Ui.ActivityChannelContent.view.ActivityChannelContent"
            android:configChanges="screenSize|orientation">

        </activity>

        <activity
            android:name=".Ui.ActivityMain.view.ActivityMain"
            android:configChanges="screenSize|orientation"/>

    </application>

</manifest>

1 个答案:

答案 0 :(得分:0)

通过添加

解决了问题
android:supportsRtl="false"

之前

tools:replace="android:supportsRtl,android:allowBackup"