Recently, I worked on releasing a new version of a Flutter app, and it was quite an experience. In this blog, we will walk through the detailed steps required to release a new version of the flutter app.
Following this guide will help ensure that the release process is smooth, efficient, and error-free.
For this guide, we’ll use a sample version: 2.2.00+220000-SNAPSHOT.
Before making any changes to the version, it’s essential to ensure the build process works correctly.
Start by running a test build(command): flutter build apk
This command will compile the app and generate an APK (Android Package) file for testing purposes.
Remove the -SNAPSHOT suffix from the version to indicate that this is a stable release.
Your version should now look like this: 2.2.00+220000
Next, commit these changes to your version control system. Use the following commands:
git add .
git commit -m "building apk for release agent-2.2.00"
git push origin master
This ensures that your version updates are tracked and saved in your repository.
Tagging the release helps in identifying the specific point in the repository history that corresponds to this version.
Use the following commands:
git tag agent-2.2.00
git push origin agent-2.2.00
Now, create the release builds for both staging and production environments.
Staging Build command for Apk and Bundle files:
flutter build apk
flutter build appbundle
flutter build apk -t lib/flavor/prd.dart
flutter build appbundle -t lib/flavor/prd.dart
Once the APK is created, you need to navigate to the root folder of your project and then go to build/app/outputs/flutter-apk
There, you will find the release APK.
appname-versionNumber-stg.apk
appname-versionNumber-prd.apk
For example, if your app’s name is “MyApp” and the version number is “1.0.0”:
MyApp-1.0.0-stg.apk
MyApp-1.0.0-prd.apk
To differentiate the production and staging builds, I used Flutter flavors. This allows for managing multiple environments efficiently within the same project. You can read more about how to set up and use Flutter flavors in my detailed blog post.
1. Test & Production Build:
flutter build ios //for test environment
flutter build ios -t lib/flavors/prd.dart //for prd environment
2. Update Version:
3. Archive and Export:
4. Submit for Review:
1. Visit Your GitHub Repository
2. Navigate to the Tagged Version
3. Create a New Release
MyApp-1.0.0-stg.apk)
and production (MyApp-1.0.0-prd.apk)
APK files in the second marked box.
4. Publish the Release
Once the APKs are ready and tagged, the next step is to upload them to the Google Play Store.
Ensure you follow the Play Store’s guidelines for releasing new versions.
After a successful release, increment the version number and build number. Append the -SNAPSHOT
suffix to indicate that this is a development version: 2.2.01+220100-SNAPSHOT
Finally, commit the updated snapshot version to your version control system:
git add .
git commit -m "increment version to 2.2.01+220100-SNAPSHOT"
git push origin master
By following these steps of commands, you ensure that the release process for the flutter app is thorough and well-documented, reducing the risk of errors and improving the reliability of each new version deployed.
Dive into our blogs and gain insights
State management is a crucial aspect of building robust and maintainable...
Losing a keystore file, which is essential for signing an Android application ...
A regular expression is a sequence of characters that pattern in text....
Transform your vision into reality with our custom software solutions, designed to meet your unique needs and aspirations.