The release buildType for Flavor A needs to be signed using one signingConfig and the release buildType for all "B" flavors need a second signingConfig. However I want all debug buildTypes to be unsigned or signed with the default debug key. The closest I got was to define a default signingConfig for the release buildType and then override that in the "A" productFlavor. But that causes both release and debug buildTypes for A to get the "A" signingConfig, which I don't want. I tried
applicationVariants.find {
it.name == "ARelease"}.signingConfig = signingConfigs.ARelease, but turns out that's a read-only property in the applicationVariants.* closure.
Any pointers? Thanks much.
My build.gradle (summarized) :
android {
...
signingConfigs {
releaseA {
...
}
releaseB {
...
}
}
buildTypes {
release {
signingConfigs signingConfigs.releaseB
}
}
productFlavors {
A {
signingConfig signingConfigs.releaseA
}
B1 {
}
...
Bn {
}
}
}