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
Like @Destil said but allow others who don't have the key to build: Easier way than previous answers:
Put this into ~/.gradle/gradle.properties
RELEASE_STORE_FILE={path to your keystore}
RELEASE_STORE_PASSWORD=*****
RELEASE_KEY_ALIAS=*****
RELEASE_KEY_PASSWORD=*****
Modify your build.gradle like this:
...
if(project.hasProperty("RELEASE_STORE_FILE")) {
signingConfigs {
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
}
buildTypes {
if(project.hasProperty("RELEASE_STORE_FILE")) {
release {
signingConfig signingConfigs.release
}
}
}
....
Then you can run gradle assembleRelease
OR
gradle build