How to add more than one `tools:replace` in Android Manifest Application?

Elye picture Elye · Aug 27, 2016 · Viewed 21.7k times · Source

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"

Answer

Elye picture Elye · Aug 29, 2016

As per Paul's answer in the comment for the question above, use the below solve my problem.

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