Andrew Fletcher published: 29 August 2023 (updated) 29 September 2023 2 minutes read
Each time a release is prepared for Google Play, the steps I work through are as follows.
Preparation to run a build
Check the Gradle build settings
Directed to the build.gradle file using the following file path
~/android/app/
The area of code in the build-gradle file to focus:
android {
signingConfigs {
debug {
storeFile file('{file-path}/private_key.pepk')
storePassword '{password}'
keyAlias '{alias}'
keyPassword '{password}'
}
release {
storeFile file('{file-path}/Android-keys/{project}/private_key.pepk')
storePassword '{password}'
keyAlias '{alias}'
keyPassword '{password}'
}
}
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId '{application-id}'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode {build-number}
versionName '{version}'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/{base-code}/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
versionNameSuffix '0'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
jniDebuggable false
renderscriptDebuggable false
}
debug {
debuggable false
jniDebuggable false
renderscriptDebuggable false
minifyEnabled false
}
}
}
As each build is prepared, update the versionCode. Currently defined above as {build-number}, and increment by one.
Running a build
In Android Studio, go to
build > Generate Signed Bundle / APK...
Select Android App Bundle
Click Next
Check the following fields
Key store path: {path}/{key}.jks
Key store password: {keystore-password}
Key alias: {key-alias}
Key password: {key-password}
check - Remember passwords
uncheck - Export encrypted key for enrolling published apps in Google Play App Signing
Click Next
The script will run creating a release. Once completed and successful, either click on locate in the pop-up window or go to the directory
~/android/app/release/
Upload or drag and drop this file on to your Google Play environment.
Related articles
Andrew Fletcher
•
29 Sep 2024
Managing app versioning in Android Studio - simplifying versionCode, versionName, and versionNameSuffix
Versioning is an important aspect of any mobile app development process. In Android, this is handled through versionCode and versionName, which allow you to define the current state of your app for users and the Play Store. But where exactly should these be managed, and how can you ensure they...
Andrew Fletcher
•
31 Oct 2023
Android icon not changing
If the Android app icon is not changing from the default icon (in my situation this was the Capacitor icon), here are some steps to troubleshoot and resolve the issue: Check the Icon FilesEnsure that you have provided the correct icon files in the appropriate directory. In a Capacitor project,...
Andrew Fletcher
•
27 Oct 2023
Working through android.permission.REQUEST_INSTALL_PACKAGES blocking releases
I'm receiving an issue with a previous release on Google Playandroid.permission.REQUEST_INSTALL_PACKAGESI'm seeing the following message in Google PlayRequest install packages permission
error - Not started - Your app isn't compliant
A permission that allows your app to install packages. If your...