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
In newer Android Studio, there is a GUI way which is very easy and it populates Gradle file as well.
File -> Project Structure
Module ->
Choose the main module ('app' or other custom name)
Signing
tab -> Plus image to add new configuration
Fill data on the right side
OK and Gradle file is automatically created
You will manually have to add a line signingConfig signingConfigs.NameOfYourConfig
inside builtTypes{release{}}
Images:
Two important(!) notes:
(EDIT 12/15)
To create signed APK, you'd have to open Terminal tab of Android Studio (the bottom of the main interface) and issue a command ./gradlew assembleRelease
If you forgot keyAlias
(what happens often to me), you will have to initiate Build -> Generate Signed APK
to start the process and see the name of the Alias key.