Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build signed apk from Android Studio for Flutter

Is there a way to build an apk for flutter in Android Studio?

I have seen this guideline: https://flutter.dev/docs/deployment/android
But here flutter console is used to build apk.

like image 979
Mangaldeep Pannu Avatar asked Apr 05 '19 13:04

Mangaldeep Pannu


People also ask

Can I develop Flutter app from Android Studio?

Step-1 : Open android studio and Go to File -> New -> New flutter Project. Step-2 : As we click on New Flutter Project we get a dialog box open. As we can see on the left side of this dialog box Flutter give us 4 different option for creating a New flutter project. Option-1 Create a New Flutter App.

Can I 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.


1 Answers

You can build the Apk/AppBundle using IDE and command line.

  • Building APK/AppBundle through IDE:

    Step-1

    In Android Studio's tab bar, click on Tools and then Flutter and then Open Android module in Android Studio:

    enter image description here

    Step-2

    Open Project it in New Window:

    enter image description here

    Step-3

    Having opened the project, click on Build and then Generate Signed Bundle / APK ...

    enter image description here


  • Building APK/AppBundle through command:

    Step-1:

    Modify your build.gradle(app) file and include your key information there:

    android {     compileSdkVersion 31     signingConfigs {         release {             storeFile file("<path-to-keys.jks>")             storePassword "********"             keyAlias "<key-alias>"             keyPassword "********"         }     }     buildTypes {         release {             signingConfig signingConfigs.release             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'         }     } } 

    Step-2:

    Build AppBundle:

    flutter build appbundle --target-platform android-arm,android-arm64,android-x64 --obfuscate --split-debug-info=/<directory> 

    Build APK:

    flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi --obfuscate --split-debug-info=/<directory> 
like image 141
CopsOnRoad Avatar answered Oct 08 '22 12:10

CopsOnRoad