How to Generate Signed apk in flutter android studio

Hi Guys,

Welcome to Proto Coders Point, In this article we will learn how to generate signed apk of your flutter code in android studio. There are various ways to create a APK file, But in this article we will check out the simplest & easiest way to do it.

NOTE: THIS ARTICLE WILL BE JUST ON GENERATING SIGNED APK FOR ANDROID PUBLICATION.

How to Build Signed APK?

You have completed your flutter project & is ready to be published to the world through play store.

Then, now you are here to know how to generate signed apk of your flutter project.

Letโ€™s Begin, Here is my Flutter Project built in android Studio(IDE),

Flutter Project Structure โ€“ Generate Signed APK.

So letโ€™s see the process of building a signed APK in flutter project.

x
How to Generate Signed apk in flutter android studio
VIDEO TUTORIAL

Time needed:ย 5 minutes.

How to generate signed apk in flutter android studio

  1. Open Android module in android studio

    In Android Studio tab bar, Navigate towords Tools > Flutter > then Open Android module in android Studio.

    Check out the screenshot for path reference.
    open android module in android studo - flutter

  2. Open Project in new window

    This will open android module version of your flutter project
    Open as new window - android studio

  3. Generate Signed Bundle/APK file

    Now, you will have a new window of your android studio, where your flutter project android verison is been opened.

    Click on Build > Generate Signed Bundle/APK


    build generate signed bundle apk
    After Clicking on it you will see a new pop dialog box, there select apk/bundle.

  4. Creating new key store path

    Click on create newโ€ฆ
    creating new keystore
    Here set a key store path there you want to create key store for your flutter project.

  5. Configure signing in gradle

    Open /android/app/build.gradle file
    Just before android block: add below keystoreProperties

    def keystoreProperties = new Properties()
    def keystorePropertiesFile = rootProject.file(โ€˜key.propertiesโ€™)
    if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
    }
    android {
    โ€ฆ
    }


    then add below code before buildType block:

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

  6. flutter clear

    Please note that after making any changes in build.gradle file, you need to run as comment in your IDE โ€œflutter clearโ€ so the the changes will affect in signing process.

  7. Select Build Varient as release

    After creating keystore & seting Alias & password hit next button.

    final step release app
    If you are creating apk for final app release on play store then select release else if you are giving for testing you can select as bebug.

  8. Full APK Signature

    You can see in above 5th step i have selected V2 (Full APK signature) to create full release version of my android flutter project

  9. Locate to the path

    Now we have created signed apk successfully, To locate to the path where release version of apk is created check out below screenshot.
    locate the path where apk is created

This article is been Refered from StackoverFlow : How to build signed apk from Android Studio for Flutter.

Easy way to set Flutter app icon