Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple entries with same key: android:allowBackup=REPLACE and android1:allowBackup=REPLACE

Tags:

android

I'm facing below using while compiling the project

Below are the error logs

Error:Execution failed for task ':sampleproject:processDebugAndroidTestManifest'.
> java.lang.IllegalArgumentException: Multiple entries with same key: android:allowBackup=REPLACE and android1:allowBackup=REPLACE

AndroidManifest.XML

<?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.sample.mini" >

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

    <uses-sdk tools:overrideLibrary="com.sample.toolkit.payment"/>

    <application
        android:allowBackup="false"
        android:icon="@mipmap/icn_app"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:supportsRtl="false"
        android:theme="@style/MaterialTheme"
        tools:replace="android:label, theme, allowBackup, android:icon,android:supportsRtl">


        <activity
            android:name="com.sample.SwiftActivity"
            android:screenOrientation="portrait"
            android:theme="@style/MaterialTheme" />

        <activity
            android:name="com.activities.TermsAndConditionActivity"
            android:screenOrientation="portrait"
            android:theme="@style/MaterialTheme" />


    </application>


</manifest>
like image 453
Lavekush Agrawal Avatar asked Jun 12 '26 01:06

Lavekush Agrawal


2 Answers

Try removing the spaces from your tools:replace list.

tools:replace="android:label,theme,allowBackup,android:icon,android:supportsRtl"

This fixed the build error for me, but I'm still trying to figure out why entries after the space are ignored

like image 192
loadedion Avatar answered Jun 13 '26 22:06

loadedion


Try to add android: to the front of allowBackup in the tools:replace list

tools:replace="android:label,theme,android:allowBackup,android:icon,android:supportsRtl"
like image 23
ChineseBoy Avatar answered Jun 13 '26 22:06

ChineseBoy