I\'m setting up an Android gradle project with a few product flavors. I would like to have the
I know this is old but now there is a new attribute called tools:node="remove"
that enables you to remove a tag from the Manifest.
Declare the header of your manifest as follows:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
Also you have to add your tag like this:
<uses-permission android:name="android.permission.INTERNET" tools:node="remove" />
I hope this helps others.
Source: HERE
Also Android documentation: HERE
EDIT:
Edited the answer to match new API changes. Thanks to Martin L. for his comment
According to docs you can:
remove permission with adding to your manifest something like this <permission android:name="permissionOne" tools:node="remove"/>
and declare separate AndroidManifest.xml parts for each flavor in
src/myFlavor/AndroidManifest.xml
which will be merged this main AndroidManifest.xml
gradle merges manifests so probably not. I have solved similar problem (broadcast receivers package names) by removing tag from main manifest and adding it to all specific flavors.