My build gradle:
signingConfigs {
general {
keyAlias 'key'
keyPassword '123abc'
storeFile file('../store.jks')
storePassword '123abc'
}
lomza {
keyAlias 'key2'
keyPassword '123abc'
storeFile file('../store.jks')
storePassword '123abc'
}
}
So, there are 2 signing configs, each one is created and intended to use to its own build flavor. It works if I choose flavor and hit Shift+F10 (or push green arrow) - chosen build flavor will generate apk signed with correct key, as configured in build.gradle:
productFlavors {
general {
applicationId <id1>
signingConfig signingConfigs.general
}
lomza {
applicationId <id2>
signingConfig signingConfigs.key2
}
}
However, if I choose Build->Generate signed apk, I am forced to set only single keystore path. If I choose to build multiple flavors, all of them will be signed with the same key, chosen in first step in "Generate signed apk" window.
How to force "Build signed apk" to use respective signing config for each flavor to build, defined in build.gradle?