How to generate signed APK for flutter in android studio
Hi developers, today we will learn how to generate a signed APK (Android Package Kit) or an AAB (Android App Bundle) file for our Flutter application.
During development, when we create an app, we usually test it by installing it on our devices. This installed version is a debug APK, which we can install and test repeatedly. However, when it comes to distributing the app through the Play Store, we need to upload a signed APK or AAB file because the Play Store doesn’t accept debug APKs.
To generate a signed APK or AAB file, you’ll need to follow these steps using Android Studio:
1- Open project in android studio.
2- Go to tools option and then Flutter and then Open Android module in Android Studio
3- One the android module is opened and code is compiled, Now you have to go to build option and select generate signed bundle or APK
4- Click on next
5- Select Create new.. option to generate new Signed key (When you release your app First Time)
6- Fill all options
Key store Path –
Path where your key store file i.e .jks file stored (as shown in above image). [Best way Select the path within your project directory.]
Key store password –
Enter password e.g. 123456
Key alias –
Enter Key alias (Name of .jks file) e.g. key
Key Password –
Enter Key password (Choose different password than Key store password) e.g. key123456
Validity(years) – Keep it as it is or change as per your requirements.
Certificate –
Fill certificate information (Not all fields are mandatory)
7- Then click OK and you will get following screen…
8- Select build variant – release
9- Click on finish and wait for a while until Gradle Build Running process complete.
And finally you will get the Generate Signed APK : (APKs) generated successfully . from that click on Locate option to get Location of your Generate Signed APK Key.
Please DO NOT lose the key and its all information i.e. Key store path,Key store password, Key alias and Key password (Best way write down it in to the note book or make text file and store on your drive while generating it.). Without this, you won’t be able to update your application because the new release will need to be signed with the same key.