In an Android project, how can one add more than one manifest into a source set?
For example, I want to merge the manifests of foo and bar.
build.gradle
manifest.srcFile 'foo/AndroidManifest.xml'
manifest.srcFile 'bar/AndroidManifest.xml'
However, in that case, bar overrides foo. How is it possible to keep both?
Attaching a comment from Android Developers docs:
// For each source set, you can specify only one Android manifest.
manifest.srcFile 'other/AndroidManifest.xml'
References:
https://developer.android.com/build/manage-manifests
https://developer.android.com/build/build-variants#sourcesets
https://developer.android.com/build/gradle-tips#create-different-versions-of-your-app
Related question: Two android manifests in one flavor