So Android Studio doesn't encourage you to sign your APK the UI way using Android Studio, instead they're directing you to use Gradle to generate it (or in complex cases, there'll be a lot of APKs generated according to different build types and flavors)
1. Declare these inside the android bracket within the gradle file within your main Android project as shown below (while putting your keystore files in your project root directory):
signingConfigs{
debug {
storeFile file("example.keystore")
storePassword "example"
keyAlias "example"
keyPassword "example"
}
release {
storeFile file("example-release.keystore")
storePassword "example"
keyAlias "example"
keyPassword "example"
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
}
}
2. Internally or externally run
./gradlew clean build assembleDebug
./gradlew clean build assembleRelease
The APK files for debug or release will be stored in the main Android project's /build/apk/ directory.
Comments
Post a Comment