Disable Manifest Merger in Android Gradle Build
Solution 1:
Edit: this is actually possible though indirectly, starting with 0.3
What you need to do is disable the processManifest task so that it doesn't run and tell the processResources where the manifest to use is:
android.applicationVariants.all { variant ->
variant.processResources.manifestFile = file('src/main/AndroidManifest.xml')
variant.processManifest.enabled=false
}
Note that if you are customizing the app package name through the DSL, you should keep the default manifest untouched in the default location to provide a consistent package name for the R classes, and then have your manually merged manifests somewhere else and point each variant processResources task to them.
Solution 2:
This may help.
android.applicationVariants.all{ variant ->
variant.outputs.each { output ->
output.processResources.manifestFile = file('AndroidManifest.xml')
output.processManifest.enabled=false
}
}
Solution 3:
For the 0.6.+ plugin you also have to change from buildVariants
to applicationVariants
:
android.applicationVariants.all { variant ->
variant.processResources.manifestFile = file('src/main/AndroidManifest.xml')
variant.processManifest.enabled=false
}