Flutter Project : How to Build Release App Bundle in Android Studio

Hello Friends, Today I am going to tell you about how to build a release app bundle in android studio for the flutter project, it is very simple to export a release bundle.

If you want to Export a project from android studio, then the method is the same as, we export the android java project export release app bundle in android studio, but in the case of a flutter the method is slightly different.

What is Different Between Java and Flutter Project?

Java and Flutter both are programming languages, and you can use these programming languages to create android applications! If you are using Flutter Programming language, which is google official programming language, you can create web apps, ios apps, and android apps.

How to Build Flutter Android App Bundle

Flutter Project

First Create your flutter project and run your application, if your application is fine then you are ready for the export project, otherwise, your application created some problems in rendering your project,

There are 2 Types of Rendering Processes

  1. You Are Creating a Fresh Flutter Project
  2. You Are Export Project for Existing Project

You are Rendering for Fresh Flutter Project

After the create your application in flutter then a big problem to render your app bundle, because of no specific option for rendering your project in the flutter environment, in the java case give a specific option for rendering your project with generate key store. the main problem is creating a store key.

Follow these steps to render your fresh project

  1. Your application is completed then first create a release apk to check your app is working fine. Build>> Flutter>>Build APK
  2. If Your application is working fine then you are ready to render your final app bundle by creating a store key,
  3. Go option menu and click on the Tools option then find the Flutter option then right-click and choose Open for editing in android studio
  4. After that follow the same process as for the java project and you get your final app bundle.
  5. you can publish your application in the google play console.

Follow these steps to render your Existing Project

If you want to update your previous application or replace app to flutter app then you should use previous package name or keystore and password. I will tell you process step by step, and you can follow and update your application successfully.

  1. Import your code and change the package name and logo other activities and complete your application
  2. after that open build.gradle and create a new property in app folder in android app
Flutter Project
Open Project   >> android  >> build.gradle

and Paste some code in build.grade file after apply plugin code

How to Implement Unity Ads in Android Studio Projects Banner or Interstitial Ads

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

after that paste final code in build.gradle file after defaultConfig

signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null // original code
            //storeFile file("key.jks") ? file("key.jks") : null //new solution for some customers
            storePassword keystoreProperties['storePassword']
        }
    }

    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.release
        }
    }

How to Create key.properties in Flutter

if you want to create a key folder for using key credential for signing apk . Select android folder and Right Click and select new and Choose file and create your key.properties folder.

and Paste this code in key.properties file and save it,

storePassword=[email protected]
keyPassword=[email protected]
keyAlias=key0
storeFile=key.jks

Complete this work after that paste your keystore in android >> app paste your keystore and rename your key store to key.jks and render your application for budle apk.

I am a Digital Marketer and Serial Entrepreneur. I am having Years of experience in the field of digital marketing. I Love Hindi Blogging, Create Brands, and Run Paid Ads. I have helped more than 100+ Clients and Companies with their Online Reputation.

Leave a Comment