I have many flavors of my Android app, and *I want all but one to use the same key*. There is one that needs to use a different key.

**How do I override the `signingConfig` for just 1 flavor of the app (but within the same build type e.g. "release")?**

* I would like all builds by default to use the main release configuration.
* I only want to *override 1 flavor*
* I want to be able to run all release builds with a single `gradlew assembleRelease` command

This last point is important as I currently have over 120 different flavors and growing. In order to customise every single flavor individually is a lot of extra work.

---

Related posts I have tried:

[Producing multiple builds signed with different keys from single build type](https://stackoverflow.com/a/17825595/383414)

* this requires configuration for each flavor
* it doesn't seem to use my custom `signingConfig` anyway

[Signing product flavors with gradle](https://stackoverflow.com/a/17074660/383414)

* accepted solution doesn't work (for me)
* according to [a comment](https://stackoverflow.com/questions/17040494/signing-product-flavors-with-gradle?rq=1#comment33498762_17044746) this is possible by putting `buildTypes` inside the `productFlavors` but I do not understand how to do this.

[Debug Signing Config on Gradle Product Flavors](https://stackoverflow.com/a/26579662/383414)

* as explained on blog post: [Building Multiple Editions of an Android App with Gradle](http://blog.robustastudio.com/mobile-development/android/building-multiple-editions-of-android-app-gradle/)
* it doesn't work actually it **works perfectly**
* but it doesn't scale well for 119 flavors

Overall, each solution seems to still use the default release config, instead of my custom config.

---

Important parts of my `build.gradle` look like this:

```
signingConfigs {
    releaseConfig {
        storeFile file('key')
        storePassword "pass"
        keyAlias "alias"
        keyPassword "pass"
    }

    custom {
        storeFile file('custom_key')
        storePassword "pass"
        keyAlias "alias"
        keyPassword "pass"
    }
}

productFlavors {
    apple {
        applicationId "demo.apple"
    }
    banana {
        applicationId "demo.banana"
    }

    // def customConfig = signingConfigs.custom
    custom {
        applicationId "custom.signed.app"
        // signingConfig customConfig
    }
 }

buildTypes {
    debug {
        applicationIdSuffix ".debug"
    }
    release {
         signingConfig signingConfigs.releaseConfig
         // productFlavors.custom.signingConfig signingConfigs.custom
    }
}

```