How to Build Flutter APK for Release – Command & Manual Methods Explained

Build Flutter APK for Release

Made a cool Flutter app? Now let’s make it ready to share with friends or put on Google Play Store by build flutter apk release!

First Things First: Make a Special Key (Like a Secret Password)

Before you can share your app, you need to give it a special lock. This proves YOU made it and nobody can change it.

Step 1: Make Your Key File

Open your computer’s command window and type this:

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

What this does: It makes a special key file that locks your app.

Note: This tool comes with something called JDK, which you probably already have if you use Android Studio.

Step 2: Save Your Passwords

  1. Go to your Flutter project folder
  2. Find the android folder inside
  3. Make a new file called key.properties
  4. Write this inside (but use YOUR passwords):
storePassword=YourPassword123keyPassword=YourKeyPassword456keyAlias=uploadstoreFile=/path/to/your/upload-keystore.jks

Important: Don’t share this file with anyone! Keep it secret!

Step 3: Tell Your App to Use the Key

  1. Open this file: android/app/build.gradle
  2. Add this code at the top (before android {):
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file(“key.properties”)if ef keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file(“key.properties”)
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
    // … other stuff …
    signingConfigs {
        release {
            keyAlias keystoreProperties[‘keyAlias’]
            keyPassword keystoreProperties[‘keyPassword’]
            storeFile file(keystoreProperties[‘storeFile’])
            storePassword keystoreProperties[‘storePassword’]
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
}

Now Let’s Build Your App!

Way 1: Using the Command Window (Fastest Way!)

  1. Open your command window
  2. Go to your app’s folder
  3. Type this magic command:
flutter build apk –release

That’s it! Your app will be ready in a few minutes.

Where to find it: Go to build/app/outputs/flutter-apk/ and look for app-release.apk

Make it Smaller (Optional):

Want to make your app download faster? Try this command instead:

flutter build apk –release –split-per-abi

This makes smaller versions for different phones!

Way 2: Using VS Code

  1. Open your project in VS Code
  2. Open the terminal (Menu: Terminal > New Terminal)
  3. Type the same command:
flutter build apk –release

Done! Check the same folder: build/app/outputs/flutter-apk/

Way 3: Using Android Studio (The Button Way)

  1. Open your Flutter project in Android Studio
  2. Click on Build menu at the top
  3. Click Generate Signed Bundle / APK…
  4. Choose Android App Bundle (best for Play Store) or APK
  5. Click Next
  6. Choose your keystore file (the .jks file you made earlier)
  7. Type in your passwords
  8. Click Next
  9. Choose release
  10. Click Finish

All done! Android Studio will show you where your app is saved!

Quick Summary

What you need:

  • A special key file (you make it once)
  • Your passwords saved safely
  • One simple command OR click some buttons

The easiest way: Just open your command window and type:

flutter build apk –release

Now your app is ready to share with the world! 🎉

Leave a Reply

Your email address will not be published. Required fields are marked *