How To Change My Android App Version Number?

  1. Open your gradle.build file located inside the app folder
  2. Look for the VersionName and VersionCode lines
  3. You want to increase the VersionName by whatever value you wish for it to be
  4. Increase the VersionCode by 1 whole integer value
  5. Save, Build, Export, and Upload!

What is the Difference Between VersionCode and VersionName?

android:VersionCode

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. :)

android:VersionName

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.

[Tweet "How to Change My Android App Version Number Tutorial http://eric-liang.com/2015/09/14/how-to-change-my-android-app-version-number/ via @ericwliang"]

References

https://developer.android.com/tools/publishing/versioning.html