Sign multiple flavors with different keystores

One of my projects has a lot of flavors, and each flavor has different keystore to sign with. As a result it has very long build.gradle project file. As each flavor need defining separate singningConfig and defining flavor signing on release buildType

After reading couple of articles, i end up with this solution:

Create signs.gradle under project folder:

Apply it in project build.gradle in the begining of the file

apply from: 'signs.gradle'

Add callbacks when signingConfigs and productFlavors is added:


The first will call our function with added signing name

The second will set signingConfig for flavor based on loaded config

Keystore information is stored in files named <flavor_name>.info under certs folder under project subfolder. The format of this file is often used to storing


Add flavor configuration

Register signing config with the same name as flavor

Create file under certs directory with information about the keystore.

Build. Enjoy.


One Reply to “Sign multiple flavors with different keystores”

  1. I simply want to mention I’m all new to blogs and certainly loved this website. Almost certainly I’m likely to bookmark your website . You really have exceptional articles and reviews. With thanks for sharing your webpage.

Leave a Reply

Your email address will not be published. Required fields are marked *