Signing configurations

Before you can publish an app on Google Play or any other app store, you need to sign it with a private key. If you have a paid and free version or different apps for different clients, you need to sign every flavor with a different key. This is where signing configurations come in handy.

Signing configurations can be defined like this:

android {
    signingConfigs {
        staging.initWith(signingConfigs.debug)

        release {
            storeFile file("release.keystore")
            storePassword"secretpassword"
            keyAlias "gradleforandroid"
            keyPassword "secretpassword"
        }
    }
}

In this example, we create two different signing configurations.

The debug configuration is automatically set up by the Android plugin and makes use of a general keystore with a known password, ...

Get Gradle for Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.