6

I am an Android app Developer using java, and I have come to know about Flutter using dart language created by Google. I found it quite intresting and because it builds the app for both Android and ios. I have created a simple TabsLayout Application for Android, the size of the Application 27MB, please have a look at the screenshot of the simple TabLayout Flutter App.

enter image description here I have two questions thats listed below

  1. I have seen that the Flutter app has size of more than 25 MB, so why the Flutter app is taking huge size after developing?

  2. How to reduce the size of Flutter app ?

Anas Reza
  • 646
  • 2
  • 9
  • 28
  • ad 1) simply use `Analyze apk` in your android studio to see what is the content of your apk – pskink Aug 09 '18 at 07:37
  • Possible duplicate of [How to reduce App (.apk) Size](https://stackoverflow.com/questions/3815269/how-to-reduce-app-apk-size) – Vikasdeep Singh Aug 09 '18 at 07:39
  • @GoldwynDator flutter apps are not created by using AS? – pskink Aug 09 '18 at 07:39
  • Flutter minimum size is more than 5MB of APK file. Maybe your App is in build for debugging, so the final APK is bigger than the one build for Release. However I think you're talking about its size when it is installed and not the APK itselfs. Installed Apps takes about the double of original APK size. – emandt Aug 09 '18 at 07:42
  • @GoldwynDator maybe 30 years ago someone was using a dumb text editor (without any context help, suggestions etc), nowadays i cannot imagine it, and memory is cheap, your time not – pskink Aug 09 '18 at 07:50
  • @GoldwynDator that is the most unjustified statement I have read today. It's like saying "you should always travel by bike, because cars use gas" – Tim Aug 09 '18 at 07:52
  • @TimCastelijns `"you should always travel by bike, because cars use gas"` the funny thing is that Dutchman said that ;-) – pskink Aug 09 '18 at 07:56
  • @emandt I have released the apk just for testing that how much size it creates and still the apk size is 7.52 and app size is 27MB – Anas Reza Aug 09 '18 at 07:57
  • @pskink unintentional :D – Tim Aug 09 '18 at 08:00

2 Answers2

11

The debug app will be larger in size , but your release app should be smaller in size approximately 7-8 MB . Minimum size of app itself is 4.7Mb see this , It is still larger compared to native app but cannot expect any thing better from cross platform

Check this documentation

Edit:- The minimum size is now down to 4.06 MB

Manohar
  • 22,116
  • 9
  • 108
  • 144
  • it's no less than that,now it's just 4.7MB [see](https://github.com/flutter/flutter/issues/16833#issuecomment-410103493) – Raouf Rahiche Aug 09 '18 at 07:44
  • 2
    @RaoufRahiche , that is the minimum size and I was telling about his app size any way thanks for the link, I will update my answer – Manohar Aug 09 '18 at 07:47
  • @so how can I reduce the size of the app – Anas Reza Aug 09 '18 at 07:57
  • 2
    The point is you cannot reduce more than 6-8mb for your app in release mode . you can never get an app with size 3-4 mb using flutter – Manohar Aug 09 '18 at 08:01
  • @Redman could you please see my another question https://stackoverflow.com/questions/51761934/apk-size-v-s-installed-app-size – Anas Reza Aug 09 '18 at 08:19
3

As of today

In Android

the download size of a minimal Flutter app (no Material Components, just a single Center widget, built with flutter build apk --split-per-abi), bundled and compressed as a release APK, to be approximately 4.3 MB for ARM, and 4.6 MB for ARM 64.

flutter build apk (defaults to --release) builds a single apk to support the target devices might result in a very large apk (fat apk) One way to reduce the size of your apk is to create multiple apks that contain file for specific screen densities or abis.

Run flutter build apk --split-per-abi

this command builds two apks's targeting arm,arm64 based devices the apk's are located at build/app/outputs

On iOS,

a release IPA of the same app has a download size of 10.9 MB on an iPhone X, as reported by Apple’s App Store Connect. The IPA is larger than the APK mainly because Apple encrypts binaries within the IPA, making the compression less efficient.

by default, we build universal binaries for iOS that include both armv7 and arm64 architectures for all three of:

  • Flutter.framework (the engine)
  • App.framework (the AOT-compiled app)
  • Runner (the entrypoint of the app)

Apple does app-thinning on their end such that the end-user downloads only the bits relevant to their device. To get the download size,

  1. log in to App Store Connect,
  2. select your app, navigate to the Activity page,
  3. select your build,
  4. then click the App Store File Sizes link.

sources:

  1. flutter FAQ
  2. Reduce --release apk and ipa sizes
Mahesh Jamdade
  • 17,235
  • 8
  • 110
  • 131