Appearance
Flutter App Versioning Guide
Updating Version in pubspec.yaml
Update the version: A.B.C+X
in your pubspec.yaml
file.
Version Format Explanation
For Android:
A.B.C
represents theversionName
(e.g.,1.0.0
)X
(the number after the+
) represents theversionCode
(e.g.,1
,2
,3
, etc.)
For iOS:
A.B.C
represents theCFBundleShortVersionString
(e.g.,1.0.0
)X
(the number after the+
) represents theCFBundleVersion
(e.g.,1
,2
,3
, etc.)
Example pubspec.yaml
yaml
name: your_app
description: Your app description
version: 1.2.0+3
Important Build Steps
For Android
Do not forget to execute one of the following commands after updating the version:
bash
flutter build apk
or
bash
flutter run
Why this is important: When you run flutter build apk
or flutter run
after updating the version
in the pubspec file, the versionName
and versionCode
in local.properties
are updated. These values are later picked up in the build.gradle (app)
when you build your Flutter project, which is ultimately responsible for setting the versionName
and versionCode
for the APK.
For iOS
Do not forget to execute one of the following commands after updating the version:
bash
flutter build ipa
or
bash
flutter run
Manual Configuration (Android)
In build.gradle (Module: app)
gradle
android {
...
defaultConfig {
...
versionCode 2 // для Google Play
versionName "1.1" // для пользователей
}
}
In Android Manifest
xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="......"
android:versionCode="26"
android:versionName="3.1.6">
Version Number Guidelines
Version Name (A.B.C)
- A - Major version (breaking changes)
- B - Minor version (new features)
- C - Patch version (bug fixes)
Version Code (X)
- Should be incremented with each release
- Used by app stores to determine if an update is available
- Must always increase for new releases
Best Practices
- Always increment version code for each release to app stores
- Follow semantic versioning for version names
- Test thoroughly after version updates
- Keep version numbers consistent across platforms
- Document version changes in your release notes
Common Version Examples
Release Type | Version Name | Version Code | Full Version |
---|---|---|---|
Initial Release | 1.0.0 | 1 | 1.0.0+1 |
Bug Fix | 1.0.1 | 2 | 1.0.1+2 |
New Feature | 1.1.0 | 3 | 1.1.0+3 |
Major Update | 2.0.0 | 4 | 2.0.0+4 |
Remember: The version code must always increase, even if you're releasing a lower version name for any reason.