Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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"
like image 212
Elye Avatar asked Oct 07 '22 16:10

Elye


People also ask

How many manifest file can be in an application?

A manifest can contain only one application node. It uses attributes to specify the metadata for your application (including its title, icon, and theme).

How do I fix a failed manifest merger?

The initial process would be to open the manifest application known as the AndroidManifest. xml and then click on the Merged Manifest tab below your edit pane. Following which, Click on the merged manifest option. An Error would be visible at the right column and then one must try to solve the error.


1 Answers

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

 tools:replace="android:supportsRtl,android:allowBackup"
like image 355
Elye Avatar answered Oct 10 '22 05:10

Elye