“Version code has already been used” means Google Play already holds a build of your app with that exact version code. The fix is to raise the version code above the highest number you have ever uploaded, rebuild the app, and upload the new file. Changing only the version name doesn’t help.
What “Version code has already been used” means
The “Version code has already been used” error means the number inside your new build matches a build Play Console received earlier. Android’s versioning guide is blunt: you can’t upload an APK “with a versionCode you have already used for a previous version.” The same holds for app bundles.
The version code is not the version users see. It is a positive integer used as an internal version number, while the version name is the only value displayed to users. Play’s version codes page describes it as a 32-bit integer that increases with each new release.
People edit the wrong field. In one Unity forum thread, a developer changed the version from v0.0.1 to v0.0.2 and still got “Version code 1 has already been used. Try another version code.” The version text had changed. The integer hadn’t.
How to fix the error in three steps
To fix the error, find the highest version code Play already has, set a higher one in your build tool, and rebuild.
- Find the highest used number. In Play Console, open Test and release > Latest releases and bundles. The version filter at the top right lists every uploaded build.
- Set a higher version code. Use the table in the next section to find the field in your tool.
- Rebuild and upload the new file. An old AAB keeps its old number no matter what you type into the release form.
Play’s update rules add two conditions: the package name must match the current version, and the bundle must carry the same signature. The full flow is in how to update an app on Google Play.
Where the version code lives in each build tool
Every build tool stores the version code in a different field, and none of them is the visible version text.
| Tool | Field to raise |
|---|---|
| Android Studio (Gradle) | versionCode in the Gradle build file |
| Flutter | The build number after the + in pubspec.yaml, as in 1.0.0+1 |
| Unity | Bundle Version Code under Player Settings, Other Settings |
| Expo | android.versionCode, or autoIncrement in eas.json |
| Cordova | android-versionCode on the widget element in config.xml |
| Web2Apk | Tracked for you per package name, with a minimum version code setting |
If both Gradle and the manifest define a version, the values in the Gradle build file override the manifest. Flutter’s build flags --build-name and --build-number override pubspec.yaml, so a CI script can silently pin an old number.
Expo can number builds itself. Set cli.appVersionSource to remote and autoIncrement to true in the production profile, and each build gets the next number. Cordova’s config reference shows the attribute sitting beside the visible version, as in version="0.0.1" android-versionCode="13".
More on the number itself: what an Android version code is.
Why the error appears when you never published that build
The error can appear for a build you never published, because an uploaded bundle stays in your app’s library after you remove it from a release. Play’s release guide says so directly: after you click Remove, you “can find the app bundle or APK again in All app bundles.”
Discarding a draft release “removes changes made in the release,” which is not the same as deleting the uploaded file. A build you pushed to internal testing last month still owns its number.
Some forum answers say deleting the old bundle frees the code. Google’s help pages don’t confirm that. The version codes page and the release guide never say a removed bundle’s number can be used again, and a Unity forum answer puts it flatly: “You may only upload one binary for each possible number.”
If the file you want is already uploaded, click Add from library in the release form to use a previously uploaded app version.
My take: never try to win a number back. Google Play allows version codes up to 2100000000. Skipping one costs nothing. Hunting for a delete button costs an afternoon.
Automated builds that keep sending the same number
Automated builds hit the same error when the pipeline builds from a fixed version code. One CI provider’s error list shows the API wording, “APK specifies a version code that has already been used,” and explains that the code matches an .aab already uploaded.
The cause is usually a hard-coded number in the repository: the first upload succeeds and every later one fails. Derive the version code from the build counter instead.
How Web2Apk handles version codes
Web2Apk tracks version codes for you, per package name, in your browser, from 1 up to 2,100,000,000. Each new build of the same package gets a higher number, so a normal update doesn’t collide with the last one.
The limitation: the counter lives in one browser and knows nothing about what Play Console holds. If you switch devices, clear browser data, or uploaded builds made elsewhere, the builder will hand you a number Play has already seen.
Set the minimum version code above the last build you released, then generate the AAB. Exporting a project backup moves the version counter with the project. Our signing and updates guide covers the rest of the update checklist.
A higher number won’t help if the package name or key is wrong. Check that you haven’t changed the package name, and that you still sign with the right key. If the key is the problem, read upload key vs app signing key.
FAQ
Can I reuse a version code if I delete the release?
Don’t count on it. Removing a bundle from a release only takes it out of that release; Play Console keeps it under All app bundles. Use a higher number instead.
Does changing the version name fix the error?
No. The version name is the text users see. Play Console compares the version code, a separate integer, so the upload fails until that number goes up.
Where do I see which version codes Google Play already has?
In Play Console, open Test and release, then Latest releases and bundles. Use the version filter to see every uploaded build, including ones that were never published.
Does the version code have to be the next number in order?
No. It only has to be greater than the current version and not used before. Gaps are fine up to Google Play’s limit of 2100000000.
Do internal testing uploads use up version codes?
Yes. A build uploaded to any track stays in your app’s bundle list, so its version code is taken even if the build never reached production.
Sources
- Version your app (Android Developers)
- Version codes (Play Console Help)
- Prepare and roll out a release (Play Console Help)
- Update or unpublish your app (Play Console Help)
- Inspect app versions on the Latest releases and bundles page (Play Console Help)
- Build and release an Android app (Flutter docs)
- How do I change the version code number that Google Play Console sees? (Unity Discussions)
- App version management (Expo docs)
- Config.xml API (Apache Cordova)
- Common Google Play errors (Codemagic Docs)