With dynamic-feature-modules it is possible to define in the AndroidManifest.xml
wheter a module should come preinstalled:
<dist:module
...
dist:onDemand="false"
dist:title="@string/title_shop">
....
</dist:module>
or not:
<dist:module
...
dist:onDemand="true"
dist:title="@string/title_shop">
....
</dist:module>
I have two build flavors in my project. The module should be preinstalled in one flavor but not in the other.
The idea is to have this default AndroidManifest.xml
in the main
source set:
<dist:module
...
dist:onDemand="true"
dist:title="@string/title_shop">
....
</dist:module>
For build flavors that should have the module preinstalled - I create a AndroidManifest.xml
file that overrides that dist:onDemand
property
to false
:
<dist:module
...
tools:replace="dist:onDemand"
dist:onDemand="false"
...
</dist:module>
Unfortunately, this does not work. The Manifest Merger fails with the following errors:
Merging Errors: Error: tools:replace specified at line:11 for attribute dist:onDemand, but no new value specified shop manifest, line 10 Error: Validation failed, exiting shop manifest.
Does anyone have an idea what's wrong here?