I have good experience in android app development using java. Recently I came to know about flutter. So, I have tried to create a simple android app with flutter based on official tutorial. But surprisingly the debug app size is 25MB and release apk costs more than 7MB. It is really larger when compare with native developed android app.
Is there any way to optimize it?
By default, launching your app with flutter run , or by clicking the Play button in your IDE (as used in Test drive and Write your first Flutter app), 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.
Get into Your_project\build\app\outputs\flutter-apk\app-release. apk Choose the app-release. apk , this file size will be smaller now.
Flutter.io (7.5 MB) The release app generated by Flutter's cli contains the C/C++ engine and the Dart VM which makes up almost all the of the apk.
One way that i use to reduce my app size is to use;
flutter clean
before i run the build command;
flutter build appbundle --target-platform android-arm,android-arm64
When i run the build command without the clean command, i get around 32mb, but if i run the clean command first, i get around 18mb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With