Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter release apk

I would like to know if the apk file produced from running the flutter run --release command is different from flutter build apk. Which is better for uploading to the playstore.? I just tried both commands and the difference in apk size is really huge. The release command produces a far smaller apk size. In summary what I want to know is since Flutter build apk =>> fat apk. Does Flutter run --release =>> split apk?

like image 737
mtkguy Avatar asked Jan 04 '20 11:01

mtkguy


Video Answer


1 Answers

flutter run --release: builds a release version of the app and starts it directly, then shows the console UI to manipulate the running instance.source flutter wiki

Use release mode for deploying the app, when you want maximum optimization and minimal footprint size. For mobile, release mode (which is not supported on the simulator or emulator), means that:

  • Assertions are disabled.
  • Debugging information is stripped out.
  • Debugging is disabled.
  • Compilation is optimized for fast startup, fast execution, and small package sizes.
  • Service extensions are disabled. (apps are smaller)

flutter build apk results in a fat which is a single APK that contains binaries for multiple ABIs embedded within it. This has the benefit that the single APK runs on multiple architectures and thus has wider compatibility, but it has the drawback that its file size is much larger, causing users to download and store more bytes when installing your application. When building APKs instead of app bundles, it is strongly recommended to build split APKs

Although app bundles are preferred over APKs, there are stores that don’t yet support app bundles

When should I build app bundles versus APKs?

The Google Play Store recommends that you deploy app bundles over APKs because they allow a more efficient delivery of the application to your users. However, if you’re distributing your application by means other than the Play Store, an APK may be your only option.

read more from the docs

like image 187
griffins Avatar answered Oct 19 '22 21:10

griffins