DEV Community

Cover image for Tips for Publishing a Flutter app on Google Play Store
Luis Barqueira
Luis Barqueira

Posted on

Tips for Publishing a Flutter app on Google Play Store

Recently, I published my very first app on Google Play Store. This post presents a set of tips that I hope to be useful for the publication of your mobile app. I divided this post into three parts. Tips are presented on each stage of the application lifecycle:

Creation of a New Flutter Project - right from Flutter project creation we must have in mind that the app will be published. Therefore, GitHub and CI/CD tool shall be introduced in this stage;

First publishing - first publishing of the app at the Play Store;

Update publishing - once the app is published, we may want to update the app.

During Creation of a New Flutter Project

Tip 1 - Introduce Github to your project. Create a repository on Github and make code changes on Git branch. Since I`m not working in a team, and this is the first app, I will do all my code changes on master branch (it is up to you to decide to have more than a branch). In the third part, where I will update my app, I will create a dev branch (we will see it soon).

Tip 2Setup a CI/CD, linking Github repository to Codemagic. I use Codemagic but it is really up to you to decide which CI/CD tool to use. Codemagic enables you to automatically publish your app to the internal, alpha, beta and production tracks on Google Play. Since I don't like to do the same thing twice, I always look to automate processes as much as I can.

First Publishing

Since we are at this stage, I will assume that all the coding is done and ready for publishing. Codemagic can be very useful to setup code signing and configure the services we want to use for receiving build notifications (email by default).
At this stage we haven't published our app on Google Play yet, so we must create an entry for our app in Google Play Console and manually upload the very first version of the app before we can automate publishing using Codemagic.

Tip 3 - Follow the Codemagic documentation, it`s really explanatory and easy to follow.
Codemagic Documentation
Regarding above documentation, I have chosen Option 1. Configure signing following Flutter's documentation.
If the build finishes successfully, generated artifacts (in our case, app-release.apk) will be published to the provided email (by default). This apk will be uploaded (drag-and drop) in the next phase (Tip 4).

Tip 4 - Go to Google Play Console and Create application (one time $25 registration fee which you need to pay before you can upload an app). Great video to follow (6:60 – 11:30): Deploying Flutter App To Playstore

Tip 5Be patient, the first publishing can take long. For my case it took 4 long days. I have chosen beta release.

Update Publishing

Now that the app (beta release) is published, I' m going to do modifications, but in a new Github branch - the dev branch. Once you are done with your development work on the “dev” branch, and validated your changes, you may want to merge the changes to the master branch.
Note that the publishing on Google Play Store feature of Codemagic was not used so far.

Tip 6 - Merge Dev Branch to Master Branch. See article 5 Steps for Code Changes Only on Git Branch and Merge to Master Once Done

Tip 7 - Returning to Codemagic CI/CD to automate the publishing at Google play store after first publishing (previously done) – follow the codemagic documentation: Codemagic - publishing on Google Play

Codemagic Publishing Report (you can ckeck it at the app github repository):
== Gathering artifacts ==
== Publishing artifacts ==
Publishing artifact app-release.apk
Publishing artifact firebase_core-release.aar
Publishing artifact firebase_storage-release.aar
Publishing artifact mapping.txt
Publishing app-release.apk to Google Play
Published app-release.apk to track beta
Publishing proguard mapping mapping.txt to Google Play

Tip 8 - Take a long coffee or a snap: Updated publishing on google play store took almost 12 hours.

You can check the app on the Google Play Store at:
https://play.google.com/store/apps/details?id=com.barqueira.cicd.demo

Github repository of the app:




Discussion (0)