176

I'm using a library that has the below in its Manifest.

<application android:allowBackup="true"
    android:label="@string/app_name"
    android:supportsRtl="true"/>

However, as the application that I use to include the library the reverse of the setting instead

<application android:allowBackup="false"
    android:label="@string/app_name"
    android:supportsRtl="false"/>

Hence it would have merger error like Is `android:supportsRtl="true"` in the Library Manifest essential? It is causing error sometimes

To solve it, we just need to add the following to our Manifest application.

tools:replace="android:supportsRtl"

and

tools:replace="android:allowBackup"

However, adding two tools:replace will have error in compilation. How could I combine the two tools:replace?

I tried the below, and it's not working.

tools:replace="android:supportsRtl|android:allowBackup"
Community
  • 1
  • 1
Elye
  • 53,639
  • 54
  • 212
  • 474

2 Answers2

375

As per Paul's answer in the comment for the question above, use comma:

 tools:replace="android:supportsRtl,android:allowBackup"
David
  • 3,971
  • 1
  • 26
  • 65
Elye
  • 53,639
  • 54
  • 212
  • 474
-1

Example:-

tools:replace="android:label,android:allowBackup,android:supportsRtl"
Bholendra Singh
  • 980
  • 7
  • 14
  • 6
    Please explain what the difference of your answer compared to the accepted answer is. Why is yours better? – BDL Jun 14 '21 at 10:01