How to disable manifest merging in Android Studio

I am having a hard time removing unnecessary (permissions) stuff from my manifest file after compiling and sigining a release version of my app.
I simply don’t want anything merged from other libraries’s manifest files. I have my own manifest file and thats it. no other manifest should be merged in

anyone knows how to completely disable manifest merging?

  • Android ZXing Get Barcode Image
  • Where should I place font file in Android resources?
  • Android Custom Calendar with Month View
  • Android: How to pass the data to sub-activities?
  • “This app won't run unless you update google play services” alert
  • Activity won't render randomly, shows only white screen on Samsung
  • Related posts:

    Retrofit 2 removes characters after hostname from base url
    any way to discover Android devices on your network?
    Android Dropdown (Select) CSS
    Android/Java: Saving a byte array to a file (.jpeg)
    Clearing user's Facebook session in Webview
    android java.lang.NoClassDefFoundError: org.bouncycastle.crypto.engines.AESEngine api 16
  • Android Studio Error Duplicate Resource
  • ant debug, and sdk.dir
  • Get the list of apps capable of handling the SEND intent to display in a View (not a popup dialog)
  • Performing action after fragment transaction animation is finished
  • AVD not running
  • Android: integer from xml resource
  • 2 Solutions collect form web for “How to disable manifest merging in Android Studio”

    Try this

     android.applicationVariants.all{ variant ->
       variant.outputs.each { output ->
         output.processResources.manifestFile = file('AndroidManifest.xml')
         output.processManifest.enabled=false
       }
     }
    

    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
    }
    

    This should work.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.