Flutter Android app release in Google Play

Logo

Create logo. If you are not a designer, use canva.com. Save it with resolution 1024×1024 in PNG format. I recommend to save image somewhere in your repository.

Now we need a lot of different sized icons for multiple resolution for all flutter-supported platforms. Load PNG-file from previous step on https://appicon.co, and download archive.

Extract archive.

  • Replace Icons in /ios/Runner/Assets.xcassets/AppIcon.appiconset
  • Replace icons in /macos/Runner/Assets.xcassets/AppIcon.appiconset
  • Replace icons in /android/app/src/main/res
  • Replace icons in /web/icons

Documentation

First, what we need is License. Call to your lawer to get EULA, or look for a OpenSource license at https://choosealicense.com. I recommend MIT.

Place the license file, named LICENSE or LICENSE.md to the root of your repository. Flutter will find it on next run.

Put somewhere in your app button, showing the license page.

showLicensePage(context: context, applicationVersion: 1.0, applicationLegalese: ‘© Denis Filonov’);

To get version number automaticaly, use package_info_plus from Flutter Community.

For approving app in AppStore and Google.Play we need a site with contacts page and Privacy Policy. If you does not collect or sell you users personal data, it can be something like this:

Privacy policy
- We do not collect personal or anonymous data.
- No registration needed.
- We do not transfer data to anybody.
- We do not use analytics and telemetry.

Website

You can create site were you want, on any free or paid service.

I recommend create site as static on GitHub Pages. It is free for open source projects and very simple. If your code is not open source, you can create different repository for site.

You can enable GitHub Pages on you repository settings page. Select branch or/and folder, where your site should be, put your html or md files on it and press “Save”. Site will be published in 10 minutes or less.

Google Play

First of all, we need to sign our app, and we need the key for it. Let’s generate it.

keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

Enter password, name, location.

Now you have key.jks in your home directory. Make the backup of this file right now! Do not check it in repository!

As alternative, you can generate key in GUI mode in Android Studio: https://developer.android.com/studio/publish/app-signing#generate-key

Create key configuration file in your app repository: /android/key.properties “storeFile” is the path to your key.

storePassword=your_password
keyPassword=your_password
keyAlias=key
storeFile=/Users/filonov/key.jks

It’s also private file, do not check it in repository, or add in .gitignore.

Find file /android/app/build.grade and add this code before “android {“.

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

android {

Change

buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }

to

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

What about minification and obfuscation? Create file /android/proguard-rules.pro with following content.

## Flutter wrapper
-keep class io.flutter.app.** { *; }
-keep class io.fluter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn io.flutter.embedding.**

Now it’s time to check all. Find application manifest: /android/app/src/main/AndroidManifest.xml. First, change the displayed app name.

<application
        android:label="Gym Sets Timer"

Change the permissions, if needed.

<uses-permission android:name="android.permission.INTERNET" />

Now we must update build number in/pubspec.yaml. It comes after +. It must be incremented every time you send app to stores.

version: 1.0.1+2

For Google Play Store we need to create not apk but appbundle (all-in-one).Build the application with command:

flutter build appbundle --release

Parameter “–release” is optional, it is used by default.

If you want to obfuscate code, use the following command, but change path to debug info.

flutter build appbundle --obfuscate --split-debug-info=/SetsTimer/debuginfo

Now open Google Play console: https://play.google.com/console. If you do not have Google Developer Account, it is the time to create it.

In Console, click on “All apps” on sidebar and press “Create app” button.

Enter app name, type and price.

Now you can see big wizard page, and you must complete all steps. Use the hints on pages.

Some steeps will not return you to dashboard, use sidebar button.Next important thing is Main store listing. Complete fields, and do nof forget about translations.

There is one big problem with this page. You can not save inbormation if you have not uploaded screenshots.

First, add Application icon. It is in the root of appicon.co’s archive.

Drag and drop it to “App icon” field.

Now we need “Feature graphic”. Go to Canva.com and make picture in seconds.

Drag and drop it in console field. I highly recommend to save all screenshots and graphics in your repository under version control for future use.

Now start android emulator and make 3-5 screenshots. You can upload them in all 3 fields.

Now we can run public test of our application or publish app on Google Play. Steps are the same. Let’s publish. Go to the bottom of dashboard.

Select Countries.

Press “Create new release” button

Now we need to upload appbundle. It is on /build/android/app/outputs/bundle/release/app-release.aab Then name release and put something to release notes. For example:

<en-GB>
  First public version.
</en-GB>
<ru-RU>
  Первая версия.
</ru-RU>

Press “Save”, “Previev release”, “Start roll-out to Production”. Relax and wait for review.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.