Your First Flutter App: Polishing the App

Apr 12 2022 · Dart 2.14.1, Flutter 2.5, Visual Studio Code

Part 4: Finish the App

33. Distribute Your App to Google Play

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 32. Distribute Your App Next episode: 34. Distribute Your App to Apple's App Store

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Transcript: 33. Distribute Your App to Google Play

At this point, the app is done. It is styled and also plays well. We have a launch screen and even some launcher icons. The last thing we need to do is get it in the hands of people who want to use it!

We’re going to build our app and distribute to the Google play store. This requires that you have google play developer account. Unfortunately, this isn’t a free. At the time of this episode, it costs twenty five dollars for such an account. The good news is that it is a one time fee.

Once you have a paid account, you can add your app. We’ll be following Google’s instructions. Just note - the process may change by the time you are watching this episode. If that’s the case, refer to the documentation. Okay, let’s get started.

Start by opening the project in progress or downloading the starter project for this episode. First, thing we need to do is assign a unique bundle identifier. In the android folder, open the build.gradle file. You can find this in the app subfolder. Add a unique id:

applicationId "com.razeware.course.flutter.bullseyeblast"

Next update the SDK version to 30 if it isn’t 30 already.

targetSdkVersion 30

Now we have to create signing key. With visual studio code open, type the following in the terminal tab.

keytool -genkey -v -keystore bullseye.jks -keyalg RSA -keysize 2048 -validity 10000 -alias bullseye

Fill out all the details. This saves a unique key in bullseye.jks Password: rotk202!Pj

Once the you have created the file, create a new file in the android folder. Call it key.properties. Open the file and add the following:

storePassword=rotk202!Pj
keyPassword=rotk202!Pj
keyAlias=bullseye
storeFile=../../bullseye.jks

Just remember if you are using source control to add the key properties to git ignore so you aren’t sharing your password. Now to access the signing key. Open build.gradle located in the android/app folder.

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

At the top of the section, make sure to set the SDK version.

compileSdkVersion 29

Inside the android section, right before the build types, add a section for the signing configs.

signingConfigs {
   release {
       keyAlias keystoreProperties['keyAlias']
       keyPassword keystoreProperties['keyPassword']
       storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
       storePassword keystoreProperties['storePassword']
   }
}

Finally, change the signing configs to use a release instead of debug.

buildTypes {
    release {
        signingConfig signingConfigs.release
    }
}

Okay that was a lot to build the signing. Now, it’s time to build the app. In the terminal window, add the following:

flutter build appbundle

When done, open the Google Play console. Click the Create New app button. Next fill out the app details. We’ll make it a game and set it to free. Then we accept the agreements.

At this point, we provide the app details. On the sidebar, look for the Store Presence option. Directly underneath, select the Main Store Listing option. Fill out the listing. Then provide screenshots. Although our app was designed to work on phones, we also provide tablet images as well.

Once done, click the save button. Then click the Dashboard button at the top of the sidebar.

Find the Setup Your App Section. Click the app access. Check that available without special access then save. Then click save. Back in the dashboard, click ads. Select none, then save.

For content rating, fill out the questionnaire and save then submit. For the target audience, set 13 and above. Click save. Then confirm that the app won’t appeal to children. Then click save.

Next, select the New App topic. This confirms if your app is a news app. If you select yes, you’ll need to provide your credentials as a news publisher. Click no. Then save.

Next click the Covid 19 tracing status. This isn’t a tracing app so check that it isn’t a publicly available contact tracing app. Then click save.

Next click Data Safety. The app doesn’t collect data, so check no, then next. Scroll down and click the privacy policy link. Add a privacy policy url then click save. I didn’t save my data policy, so I set it again and save.

Now set the Store Settings. Set it to a game and with a category being a puzzle. Then add store contact details. Click save.

Now to create a release. Scroll down to the publish category. Click the select countries and regions. I’ll get started by creating a new release. Upload the binary, then fill out the release information.

We’re getting an error because we haven’t set the release territories. Return back to the dashboard. Select the countries and regions. Click the add button. Then choose all the buttons. Save the changes.

At this point, almost everything is good to go. Head back to the Dashboard and scroll down to the bottom. Look for the publish your app on Google play. Click on the Select countries and region. In this case, we’ll publish to all countries. Click the add button.

Finally, click the Edit Release button. Then click the review release button. Now finally, you can press the Start rollout to Production button.

At this point, Google will review your app and when its done, you will receive an email letting you know that your app is approved or that it needs more work. Keep in mind that it can take a few days for the app review to proceed.