- Open your gradle.build file located inside the app folder
- Look for the VersionName and VersionCode lines
- You want to increase the VersionName by whatever value you wish for it to be
- Increase the VersionCode by 1 whole integer value
- Save, Build, Export, and Upload!
What is the Difference Between VersionCode and VersionName?
The VersionCode is an integer value. The user cannot see this value, and you do not want to show this value to the user. The VersionCode is used for detecting whether the app is an upgrade or a downgrade version of the app that you are building. Therefore, every time you want to upload a new version of the app, the VersionCode must increment by a value of ‘1.’ This is regardless of whether the update or changes you’ve made is major or minor!
For example, let’s say the VersionCode of my Android app Goal Striver, has a VersionCode of 2. Today, I updated the app, and wish to publish it. Before I can create the apk file from Android Studio, I will have to change the VersionCode to 3.
Note – You only increment the VersionCode when you plan to upload the updated app to the Google Play Store! In other words, you do not have to increment the VersionCode for every single update or change you make offline without planning to upload it to the Play Store. 🙂
The VersionName is a string value. The user can see this value. In fact, they should be able to see this value.
So back to the previous example. Let’s say the update that I’m uploading with a VersionCode value of ‘3’ is going up. That means if I want to increment my app’s update values by 0.01, I would have a VersionName value of 1.03 since the VersionCode is 3, which implies that this would be the 3rd time that I’m uploading the app to the Play Store.
Congratulations! You now know how to change your android app’s version number. If you have any comments or questions, feel free to leave it below, and I’ll answer them as soon as possible.