What Is the Max versionCode on Android? Google Play's 2100000000 Limit and a 4-Step Flutter Check
What is the maximum versionCode on Android and Google Play?
The highest versionCode Google Play accepts is 2100000000 (2.1 billion). The Android versioning guide says versionCode is a positive integer used as an internal version number, that each release must use a greater value, and that "the greatest value Google Play allows for versionCode is 2100000000." In a Flutter app, that number is the build number after the + in pubspec.yaml, so a date-based build number can hit the limit sooner than you'd expect. GSPTeck is giosaia's indie studio building mobile and web apps with Flutter and Firebase; this guide was checked against the Android and Flutter docs on 2026-11-23.
versionCode vs versionName: which number has the limit?
Short answer: only versionCode has the 2100000000 ceiling. versionName is the string users see, such as 1.4.2, and the Android guide calls it "the only value displayed to users."
| Setting | Type | Who sees it | Rule from the Android docs | Flutter source |
|---|---|---|---|---|
versionCode | Positive integer | Android, Google Play, other apps | Must increase with every release; Play's maximum is 2100000000; a used code can't be uploaded again | Build number after +, or --build-number |
versionName | String | Users | Any format, for example major.minor.point | Version before +, or --build-name |
The Android system also uses versionCode to block downgrades: a user can't install an APK with a lower code than the version already on the device. That is why the number only ever goes up.
Where Flutter sets versionCode
Short answer: in pubspec.yaml. The Flutter Android deployment guide shows version: 1.0.0+1, where 1.0.0 is the version and 1 is the optional build number after the +. On Android, the build name becomes versionName and the build number becomes versionCode.
The same guide says both can be overridden at build time with --build-name and --build-number, and that the Gradle file reads them as flutter.versionCode and flutter.versionName, so you generally don't edit them by hand. When you rebuild, Flutter writes the new values into local.properties. A quick check before every upload:
# pubspec.yaml
version: 1.4.2+37 # versionName 1.4.2, versionCode 37
# or override in CI
flutter build appbundle --build-name=1.4.2 --build-number=37
If Play rejects the upload because the number was already taken, that is a different problem; see how to fix "version code already used" in Flutter.
The 4-step Version Code Budget
Pick a scheme once, check that it stays under the cap for the life of the app, and enforce it in your build. These four steps take a few minutes and prevent a release-day surprise.
- Write down your current code. Look up the highest
versionCodeyou have ever uploaded in Play Console, on any track. Your next code must be higher than every one of them, because Play won't accept a code you have already used. - Choose one scheme. A plain counter (1, 2, 3...) is the scheme the Android guide describes: start at 1 and increase it with each release. A date scheme is fine if you check its largest possible value first (step 3).
- Compute the worst case. Plug the latest date or the largest counter you could realistically reach into the scheme and compare it with 2100000000. If the result is bigger, the scheme fails, even if today's value fits.
- Fail the build early. Add a CI check that reads the build number and stops if it isn't greater than the last uploaded code or is above 2100000000. Catching it before
flutter build appbundleis cheaper than a rejected upload.
Worked examples: which schemes fit under 2100000000?
Short answer: a counter or YYYYMMDDNN fits; yyMMddHHmm doesn't. The arithmetic below uses 23 November 2026 at 08:00 as the example build time.
| Scheme | Example value | Under 2100000000? | Notes |
|---|---|---|---|
| Counter | 37 | Yes | Room for more than two billion releases |
YYYYMMDDNN (date plus 2-digit build of the day) | 2026112301 | Yes | Allows 100 builds a day; stays under the cap through 31 December 2099 (2099123199) |
yyMMddHHmm (2-digit year to the minute) | 2611230800 | No | Already above the cap for any year from 2021 on, because 2101010000 is larger than 2100000000 |
yyMMddHH (2-digit year to the hour) | 26112308 | Yes | Small number, but it drops below an earlier YYYYMMDD-style code if you ever switch |
The last row shows the trap with switching schemes. If an app once shipped 2026112301 and you later move to yyMMddHH, the new value 26112408 is lower, so Play treats it as a downgrade and won't take it. Once you have used a large code, every future code must stay above it.
What happens if you reach the cap?
Short answer: you can't ship another update under that package name. Each upload needs a code higher than the last, and Play's maximum is 2100000000, so a release at or near the ceiling leaves little or no room. Plan the scheme before that happens, because the downgrade rule means you can't reset to a small number later.
Two habits keep you far from that point. First, don't multiply the code for extra digits you don't need. Some teams add an ABI or flavor digit by multiplying by 10 or 100; each extra digit uses up the headroom ten times faster. The Android docs describe pre-set versionCode ranges only for publishing multiple APKs, and an app bundle upload doesn't need them. Second, never jump the code to a huge value to fix a one-off conflict. A jump from 37 to 2000000000 is accepted once, and then only 100 million codes remain.
These checks belong in your release routine next to the Flutter and Firebase Google Play release checklist, and they matter most when you push builds often, as in staged rollouts on Google Play.
FAQ
Is 2100000000 the same as the Java int limit?
No. The largest signed 32-bit integer is 2147483647, but Google Play's own limit is lower. The Android versioning guide states that the greatest value Google Play allows for versionCode is 2100000000, so plan against that number.
Can I lower the versionCode after a bad release?
No. Android blocks installing a lower versionCode over a higher one, and Play won't accept a code you have already used. Fix the bug and ship it with a higher code instead.
Does the Flutter build name have a limit too?
The Android guide describes versionName as a string in any format, and it lists no numeric maximum for it. The 2100000000 limit applies only to versionCode, which Flutter takes from the build number.
Do internal and closed testing builds use up version codes?
Yes. Play won't accept a code that was already uploaded for a previous version, whatever the track. Count test builds when you plan your scheme.
Sources
- Android Developers: version your app (versionCode, versionName and the 2100000000 limit) (checked 2026-11-23)
- Flutter docs: build and release an Android app (build name and build number) (checked 2026-11-23)
More Flutter and Google Play notes from the same studio are on the GSPTeck apps and official links page and the GSPTeck homepage.