Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between build and release in flutter?

Why the size of flutter build apk --release is larger than the size of flutter run --release which reduces the size by half. I need to get the leaner app size.

like image 720
kartik Avatar asked Oct 23 '25 14:10

kartik


2 Answers

We should know that flutter run --release compiles only for a target ABI (because you run the generated APK directly to your device). while, flutter build apk --release results in a fat APK (Universal apk) that contains your code compiled for all the target ABIs, as a result, you could install this apk on any device.

Flutter app can be compiled for

  • Armeabi-v7a (ARM 32-bit)
  • Arm64-v8a (ARM 64-bit)
  • x86-64 (x86 64-bit)
like image 62
BADER EDDINE QODIA Avatar answered Oct 26 '25 03:10

BADER EDDINE QODIA


As of now, there are three main CPU architectures used in Android smartphones.

  • ARM: ARMv7 or armeabi
  • ARM64: AArch64 or arm64
  • x86: x86 or x86abi

flutter run --release compiles only for your connected devices ABI (Application Binary Interface). So, you can install that apk only those devices that can matched with your device only.

flutter build apk --release compiles for all architecture, that's why you can install your apk on any device or any CPU architectures.

like image 20
HasanToufiqAhamed Avatar answered Oct 26 '25 03:10

HasanToufiqAhamed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!