How to create apk file in flutter android studio

How to create apk file 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.

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),

How to create apk file in flutter android studio
Flutter Project Structure – Generate Signed APK.

So let’s see the process of building a signed APK in flutter project.

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.

    How to create apk file in flutter android studio

  2. Open Project in new window

    This will open android module version of your flutter project

    How to create apk file in flutter 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

    How to create apk file in flutter android studio

    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

    How to create apk file in flutter android studio

    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.

    How to create apk file in flutter android studio

    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.

    How to create apk file in flutter android studio

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

Easy way to set Flutter app icon

How to create apk file in flutter android studio

How do I make an APK file in Flutter?

Build an APK.
Enter cd [project].
Run flutter build apk --split-per-abi. (The flutter build command defaults to --release .).

How can I create APK file in Android Studio?

In the menu bar, click Build > Generate Signed Bundle/APK. In the Generate Signed Bundle or APK dialog, select Android App Bundle or APK and click Next. Below the field for Key store path, click Create new.

Can we create app using Flutter?

Flutter is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source. In this codelab, you'll create a simple mobile Flutter app.

Can we convert Android app to Flutter?

Simply put, you can migrate your iOS/Android app into Flutter seamlessly without compromising on performance. Even our team has leveraged this feature to convert an existing application to a Flutter app. And in this blog, we will be talking about Kody's developed milk delivery application written in Android.