
When building and releasing apps in Flutter, understanding the difference between the app version and the build number is crucial. These two concepts play distinct roles in the development and release cycle, and knowing when and how to update them ensures a smooth development process and clear communication with users and app stores.
This guide will break down their differences, when to change them, and include a practical example at the end.
What is an App Version?
The app version is the public-facing identifier of your app. It indicates the current state of the app in terms of features and functionality and is visible to end users.
App Version (e.g., 1.0.4)
Purpose:
- Represents the public-facing version of your app, indicating the feature set or changes in functionality.
- Typically follows the semantic versioning format: MAJOR.MINOR.PATCH.
- MAJOR: Increment when introducing significant changes, like breaking backward compatibility.
- MINOR: Increment for adding features in a backward-compatible manner.
- PATCH: Increment for bug fixes or small changes that don’t add new features.
When to change:
- MAJOR: If the app undergoes a major redesign or incompatible changes.
- MINOR: When new features or functionalities are introduced.
- PATCH: For bug fixes or small tweaks that don’t affect functionality.
Build Number (e.g., 4)
Purpose:
- Represents an internal identifier for the app build.
- Used by app stores (like Google Play and Apple App Store) to differentiate between uploads of the same app version.
- Doesn’t need to follow semantic versioning; typically just an incrementing integer.
When to change:
- Always increment the build number for each release, even if the app version remains the same.
- For example, if you fix an issue in version 1.0.4 and resubmit to the store, increase the build number (e.g., 1.0.4+5).
In Flutter (pubspec.yaml):
You define the app version and build number like this
version: 1.0.4+4
- 1.0.4 → App version
- 4 → Build number
When publishing to app stores:
- Android: Build number maps to versionCode in build.gradle.
- iOS: Build number maps to CFBundleVersion.
Guidelines:
- For App Updates with Feature Changes:
- Change both the app version (to reflect the feature update) and build number.
2. For Re-Uploads (Bug Fixes/Hotfixes):
- Change only the build number, keeping the app version the same.
3. Major App Overhaul:
- Increment the MAJOR version and reset the build number.
By maintaining this distinction, you ensure clarity for both your users (through app version) and app stores (through build number).
Example: Practical Workflow
Let’s say you’re developing an app called “TaskMate”.
- Initial Release:
- App Version: 1.0.0
- Build Number: 1
- Reason: This is the first stable release of your app.
2. Adding a New Feature (e.g., Dark Mode):
- App Version: 1.1.0
- Build Number: 2
- Reason: A new, backward-compatible feature was added.
3. Fixing a Bug in Dark Mode:
- App Version: 1.1.1
- Build Number: 3
- Reason: A bug was fixed without adding new functionality.
4. Major Redesign:
- App Version: 2.0.0
- Build Number: 1
- Reason: The app underwent a major redesign with breaking changes.
5. Re-submitting After Store Rejection:
- App Version: 2.0.0
- Build Number: 2
- Reason: The app store rejected the submission, so you fixed the issue and resubmitted.
By following this systematic approach, you ensure your app’s development lifecycle is organized, user-friendly, and compliant with app store requirements.