Manifest Merger Error When Using Dynamic Features And Build Flavors
Solution 1:
This answer worked for me. The idea is to have two copies of the AndroidManifest.xml, which are identical except
<dist:module
...
tools:node="replace"
dist:onDemand="false">
...
</dist:module>
which replaces the whole element.
Solution 2:
The manifest merger tool combines all XML elements from each file by following some merge heuristics. If the merger tool finds that both manifests contain the same attribute with different values, then a merge conflict occurs.
Docs: https://developer.android.com/studio/build/manifest-merge
Solution 3:
To expand on celaeno's answer
If I tried to have just debug
and release
(or whatever your two build types are) AndroidManifests that were full and exact copies except changes to dist:onDemand
line. This didnt' work. Gradle yelled at me about a missing src/main/AndroidManifest.xml
. So I actually created three files:
- main
<manifestxmlns:android="http://schemas.android.com/apk/res/android"xmlns:dist="http://schemas.android.com/apk/distribution"package="com.example.somefeature"><application...><activityandroid:name=...
</activity></application><!-- NO dist:module block --></manifest>
debug
<dist:moduledist:instant="false"dist:title="@string/somefeature"> <dist:delivery><dist:install-time /></dist:delivery><dist:fusingdist:include="true" /> </dist:module>
release
<dist:moduledist:instant="false"dist:title="@string/somefeature"> <dist:delivery><dist:on-demand /></dist:delivery><dist:fusingdist:include="true" /> </dist:module>
Post a Comment for "Manifest Merger Error When Using Dynamic Features And Build Flavors"