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 propagate correctly across your project? This article covers the essentials of managing app versioning in Android Studio, using the build.gradle file.
How to generate a new private key (.pepk)
How to generate a new private key and submit it to Google Play for signing your Android app, you can follow these steps:
Generate a New Keystore (Private Key)
You can generate a new keystore file (which includes the private key) using the keytool utility that comes with the Java Development Kit (JDK). Open a command prompt or terminal and run the following command to generate a new keystore:
Error DerInputStream.getLength(): lengthTag=107, too big
DerInputStream.getLength(): lengthTag=107, too big
error com.android.ide.common.signing.KeytoolException: Failed to read key upload from store
Resources
Type | Version |
---|---|
Android Studio | Android Studio Giraffe | 2022.3.1 Patch 1 |
Gradle | 7.4.2 |
When attempting to run an Android build, I'm seeing the following error
Class referenced in the manifest 'com.{app_name}.app.MainActivity' was not found in the project or the libraries
Updating the Android app and while testing I'm seeing the following error in the AndroidManifest.xml file
Class referenced in the manifest, `com.{app_name}.app.MainActivity`, was not found in the project or the libraries
And the accompanying error
Unresolved class 'MainActivity'
Steps to creating an Android build using Android Studio
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: