
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
- Go to your Flutter project folder
- Find the android folder inside
- Make a new file called key.properties
- 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
- Open this file: android/app/build.gradle
- 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!)
- Open your command window
- Go to your app’s folder
- 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
- Open your project in VS Code
- Open the terminal (Menu: Terminal > New Terminal)
- 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)
- Open your Flutter project in Android Studio
- Click on Build menu at the top
- Click Generate Signed Bundle / APK…
- Choose Android App Bundle (best for Play Store) or APK
- Click Next
- Choose your keystore file (the .jks file you made earlier)
- Type in your passwords
- Click Next
- Choose release
- 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! 🎉