Skip to content

Google Play upload errorGoogle Play: “You need to use a different version code for your APK or Android App Bundle”

You upload a new build to Play Console and it’s refused: the version code is already used. Each upload needs an internal version code that no earlier upload used, even if the version users see stays the same. Here’s where that number lives, in Android’s and Flutter’s words.

Short answer

Raise versionCode above every build you’ve uploaded before, rebuild and upload again. In Flutter, versionCode is the build number after the + in pubspec.yaml’s version line, so change 1.0.0+1 to 1.0.0+2. If your build script passes --build-number, change it there instead.

Why Play refuses the build, and the fix

  1. 01

    The versionCode was used by an earlier upload

    “You can't upload an APK to the Play Store with a versionCode you have already used for a previous version.” Android Developers, Version your app

    Play compares versionCode, a whole number, not the version name users see. Android says each successive release should use a greater value, and Play refuses a versionCode you have already used.

  2. 02

    Flutter: the build number in pubspec.yaml didn’t change

    “In Android, build-name is used as versionName while build-number used as versionCode.” Flutter, Build and release an Android app

    In Flutter you generally don’t need to edit versionCode in Gradle. It comes from the number after the + in the version line of pubspec.yaml. Raise it and rebuild.

    version: 1.0.0+1
  3. 03

    A build script overrides the number

    “Both the version and the build number can be overridden in Flutter's build by specifying --build-name and --build-number, respectively.” Flutter, Build and release an Android app

    A CI script or build command can set the number with --build-number, which overrides pubspec.yaml. If the upload keeps failing after you raise the pubspec value, check the build command.

Checked against the vendor’s docs on : Android Developers: Version your app; Flutter docs: Build and release an Android app.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: Google Play 12 testers for 14 days · Expo EAS Build failed · Google Play Data safety form rejected · Google Play Photo and Video Permissions

Questions

More on this launch

Does the version users see have to change too?

No. Android says versionCode is not the version number shown to users; that’s versionName. Only versionCode has to go up.

Is there a highest allowed number?

Yes. Android notes that the greatest value Google Play allows for versionCode is 2100000000, so date-based schemes need to fit under it.

Can you fix it for me?

Yes, through the App Fix Ticket: you send the error and access to the project, Simon fixes the versioning and the build so the upload goes through. Each step has a fixed price, paid upfront.

Something else?

Describe it and get a written quote

Describe the app and where it is in the launch. You get a written scope, a fixed price and a timeline; we reply by email, usually within one business day.