I would like to have my Gradle build to create a release signed apk file using Gradle.
I\'m not sure if the code is correct or if I\'m missing a parameter when doing
You should not put your signing credentials directly in the build.gradle file. Instead the credentials should come from a file not under version control.
Put a file signing.properties where the module specific build.gradle is found. Don't forget to add it to your .gitignore file!
signing.properties
storeFilePath=/home/willi/example.keystore
storePassword=secret
keyPassword=secret
keyAlias=myReleaseSigningKey
build.gradle
android {
// ...
signingConfigs{
release {
def props = new Properties()
def fileInputStream = new FileInputStream(file('../signing.properties'))
props.load(fileInputStream)
fileInputStream.close()
storeFile = file(props['storeFilePath'])
storePassword = props['storePassword']
keyAlias = props['keyAlias']
keyPassword = props['keyPassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
// ...
}
}
}