Flutter Apps Are Too Big in Size

Flutter apps are too big in size

Flutter team acknowledges it here.

There's an explanation for this here, quoting the same -

In August 2018, we measured the size of a minimal Flutter app (no
Material Components, just a single Center widget, built with flutter
build apk), bundled and compressed as a release APK, to be
approximately 4.7MB.

For this simple app, the core engine is approximately 3.2MB
(compressed), the framework + app code is approximately 840KB
(compressed), the LICENSE file is 55KB (compressed), necessary Java
code (classes.dex) is 57KB (compressed), and there is approximately
533KB of (compressed) ICU data.

Of course, YMMV, and we recommend that you measure your own app, by
running flutter build apk and looking at
build/app/outputs/apk/release/app-release.apk.

Also, the relative differences in apk size would likely be smaller with larger apps. Flutter's overhead size is fixed.

Flutter app size is huge

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

Flutter app size huge, how to reduce for ios

By default, launching your app with flutter run, or by clicking the Play button in your IDE generates a debug build of the Flutter app. The app size of a debug build is large due to the debugging overhead that allows for hot reload and source-level debugging. As such, it is not representative of a production app end users download.

Breaking down the size
Starting in Flutter version 1.22 and DevTools version 0.9.1, a size analysis tool is included to help developers understand the breakdown of the release build of their application.

flutter build ios --analyze-size

Reducing app size
When building a release version of your app, consider using the --split-debug-info tag. This tag can dramatically reduce code size. F
Some of the other things you can do to make your app smaller are:

Remove unused resources
Minimize resource imported from libraries
Compress PNG and JPEG files

For more info check this

How to reduce the size of Flutter .aab file?

Regarding to the flutter official documentation.

Reducing app size

When building a release version of your app, consider using the --split-debug-info tag. This tag can dramatically reduce code size. For an example of using this tag, see Obfuscating Dart code.

Some other things you can do to make your app smaller are:

  • Remove unused resources
  • Minimize resource imported from libraries
  • Compress PNG and JPEG files

Build the .abb

  1. Clean your project
flutter clean

  1. Build an appbundle using the --split-debug-info tag
 flutter build appbundle --obfuscate  --split-debug-info=<the-path>

Note the <the-path>, a location where your app-release.aab will be copied.


Output

 Building with sound null safety br>
Running Gradle task 'bundleRelease'... 94,8s
✓ Built build/app/outputs/bundle/release/app-release.aab (17.5MB).

Note that the final size of my app-release.aab is 17.5MB.


For more details recarding to deploy flutter android app read the official documentation.

Download size

After deploying my Flutter app to playstore, I was surprised to see that the download size is finally 6.4M.

Sample Image

This is a full app in production, not just a default flutter counter app. You can try it on playstore.



Related Topics



Leave a reply



Submit