Maintaining Android app version codes sustainably
Android requires app version codes to increase with every release to prevent accidental downgrades, and Google Play sets a strict maximum limit for version codes. Using a numbering scheme that increases quickly can restrict you from publishing updates in the future. To make sure your app remains updatable for years to come, it’s important to understand how app versioning works, and to adopt a scalable strategy for generating version codes.
About app versions
Android apps uses two primary versioning attributes:
versionCode: A 32-bit integer that consistently increases with each new release. It’s used internally by the Android system and Google Play to determine if one version is more recent than another.versionName: A string that represents the user-facing version number, for example, "1.0.0", "1.1 Beta", "2.0". This is what users see in Google Play and on their devices.
For more detailed guidance on how to choose version codes, refer to the Android Developers documentation on Multiple APKs and Version Codes.
Approaching the maximum version code limit
Google Play enforces an upper limit for version codes. The greatest value Google Play allows for a versionCode is 2,100,000,000. While this number may seem high, unmanaged or inefficient versioning can cause issues for your app, such as:
- Being prevented from publishing updates: If your app's
versionCodereaches or exceeds the maximum limit, you can no longer be able to upload new APKs or app bundles to Google Play for that application. This means no more bug fixes, new features, or compatibility updates for your users.
To avoid reaching the maximum version code limit:
- Adopt a sustainable
versionCodestrategy: Implement aversionCodegeneration strategy that ensures a gradual and consistent increase, and avoids rapid consumption of the available range. - Monitor
versionCodeusage: Regularly track your app'sversionCodeprogression to anticipate when it might approach the limit. - Implement automated checks: Integrate checks within your build and release processes to warn or prevent the use of excessively high
versionCodevalues.
If you do reach the maximum limit for version codes, Google Play may be able to provide support. Get in touch with the Google Play support team for help.