“Version code 1 has already been used”: how to fix it
Why Google Play rejects a bundle whose version code it has seen before, and where to raise versionCode in Android Studio, Flutter, React Native, Expo and Unity.
You upload a bundle and the Play Console says: “Version code <N> has already been used. Try another version code.” Older versions of the console said: “You need to use a different version code for your APK because you already have one with version code <N>.” It means a bundle with that same versionCode was already uploaded to this app.
Why it happens
versionCode is an internal whole number that tells Android and Google Play which build is newer. Google Play won’t accept a version code you have already used for this app. The usual reasons you hit it:
- You changed the version name but not the code. Going from 1.0.0 to 1.0.1 doesn’t change versionCode by itself.
- A test build used the number. Every track (internal, closed, open, production) belongs to the same app, so a build sent only to internal testing still takes its version code.
- Your framework reset it. A Flutter build without +N in pubspec.yaml, or a regenerated native project, can fall back to 1.
- Your CI or EAS counter is behind. Builds made outside your normal pipeline used numbers it doesn’t know about.
How to fix it
- In the Play Console, open App bundle explorer and find the highest version code already uploaded to this app.
- Set versionCode to a higher number (see the table). It has to be a positive whole number, at most 2100000000.
- Rebuild the release bundle. Make sure you upload the new file, not an older one from the same folder.
- To stop it happening again, raise the number automatically on every release build, for example from your CI build number or with EAS autoIncrement.
| Project type | Where versionCode is set |
|---|---|
| Android Studio (Kotlin/Java) | versionCode in defaultConfig in app/build.gradle(.kts); product flavors can override it |
| Flutter | The number after + in pubspec.yaml (version: 1.0.0+2), or flutter build appbundle --build-number=2 |
| React Native (bare) | versionCode in defaultConfig in android/app/build.gradle |
| Expo | android.versionCode in app.json or app.config.js; with EAS, set cli.appVersionSource and autoIncrement: true in eas.json, or run eas build:version:set |
| Unity | Player Settings → Other Settings → Identification → Bundle Version Code |
Questions people ask
Can I reuse a version code after deleting a release?
Don’t plan on it. Google’s rule is that you can’t upload with a versionCode you already used, so pick a number higher than anything you have uploaded.
Does versionCode have to go up by exactly one?
No. Any higher number works. Many teams use a CI build number or a date-based number, as long as it stays under 2100000000.
Is the version code shown to users?
No. Users see versionName, such as 1.2.0. versionCode is only for Android and Google Play.
Unity adds 100000 or 200000 to my code. Why?
With Split APKs by target architecture turned on, Unity adds 100000 for ARMv7 and 200000 for ARM64 so each APK has a unique code. Keep the base number under 100000 in that setup.
Sources
Check your own name
Domains, both app stores, bundle IDs and every live site using the name, in under a minute.
Check a name