— Flutter, Play Store, Versioning — 1 min read
When releasing an update to your Flutter app on the Google Play Store, it's crucial to properly upgrade the version code and name. This guide walks you through the steps to ensure your app's new version is accepted by the Play Store.
In Flutter, the app version is defined in the pubspec.yaml file. The version format is X.Y.Z+n, where:
X.Y.Z represents the version name (e.g., 1.2.0).n represents the version code, which is an integer (e.g., 3).Every new release should have a unique version code.
pubspec.yamlLocate the version line in your pubspec.yaml file and update it. For example:
1version: 1.2.1+4flutter pub getAfter updating the pubspec.yaml, run the following command in your terminal:
1flutter pub getThis updates your local properties with the new version information.
Build your APK or App Bundle with one of the following commands:
1flutter build apk1flutter build appbundleAfter building your app, verify the version code and name in the build output or by inspecting the APK or App Bundle.