1

This is my app’s manifest which I want to override the android:supportsRtl tag for all of my libraries

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

I have 5 libraries which I want to replace the android:supportsRtl=”false” using tools:replace.

But there is one library which I want to let it supportRtl.

The question is that, can I make an exception for the library which needs android:supportsRtl="true" to actually support the RTL and leave the other libraries to be overridden by my app and stay android:supportsRtl="false"?

Morteza Rastgoo
  • 6,772
  • 7
  • 40
  • 61

1 Answers1

1

Unfortunately, currently it is not possible. What you have to do is to come the other way around, i.e. specify what packages this markers should be applied to.

Make use of marker selector tools:selector specifying package names of other 4 libs you want the tools:replace to be applied to.

tools:selector="com.package.lib1, com.package.lib2"

EDIT

As mentioned by OP in comments, this will work only for <permission> tag.

azizbekian
  • 60,783
  • 13
  • 169
  • 249
  • Good point! But I think I end up with the merge conflict with the library manifest which stated in the manifest `android:supportsRtl="true"` :( – Morteza Rastgoo Feb 07 '17 at 09:11
  • I can't understand the exact scenario, where a conflict would result. You have 5 modules, and in selector you mention, that you want to override merging rules for 4 of them. The fifth one would just come with the value it had. Why would it conflict? – azizbekian Feb 07 '17 at 09:14
  • It turned out that `Selector` marker is defined on `permision` tag and not on `application` tag. Doing this fails build. – Morteza Rastgoo Feb 08 '17 at 12:22
  • Take a deeper look at your link from developers site: https://developer.android.com/studio/build/manifest-merge.html#marker_selector – Morteza Rastgoo Feb 08 '17 at 12:23