Flutter: Upgrade The Version Code for Play Store

Upgrade my version code of the app for play store

1.1.0 is called version name. it is just a string separated by period(.)
+
2 is build number which need to be incremented each time when you create build.

In Play Store, version name does not matter, only build number needs to be unique every time. if you upload a build using 1.1.0+2 than you are allowed to keep the version name same, if each time you have unique build number.
Explore more at https://developer.android.com/studio/publish/versioning

In App Store, for each version name you can have every build number. if your version name is 1.0.0 than you can have build no from 1 to n and again when you update your version name to 2.0.0 than you are allowed to have build no from 1 to n.
Explore more at
https://developer.apple.com/library/archive/technotes/tn2420/_index.html

Playstore Error - You need to use a different version code for your APK or Android App Bundle because you already have one with version code 4

In Flutter project pubspec.yaml
Change version like this

version: 2.0.1+5  --> 2.0.1 is version name & 5 is version code

When you update the app make sure you update the version code last code +1.

Also, you can change it manually
Gradle file two property (In android project folder)

versionCode 5--> make sure increase version code number
versionName '2.0.1'

How to set build and version number of Flutter app

Setting the version and build number

You can update both the version name and the version code number in the same place in pubspec.yaml. Just separate them with a + sign. For example:

version: 2.0.0+8

This means

  • The version name is 2.0.0
  • The version code is 8

This is described in the documentation of a new project (but you might have deleted that if you are working on an old project):

The following defines the version and build number for your application.
A version number is three numbers separated by dots, like 1.2.43
followed by an optional build number separated by a +.
Both the version and the builder number may be overridden in flutter
build by specifying --build-name and --build-number, respectively.
Read more about versioning at semver.org.

version: 1.0.0+1

Re-enabling auto versioning

If your Flutter versioning is not automatically updating anymore, see this answer for how to fix it.

See also:

  • How to get build and version number of Flutter app

Flutter appbundle version code error. Version code 20220304 has already been used. Try another version code

Just need to remove build folder from project root directory.



Related Topics



Leave a reply



Submit