Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter apps are too big in size

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?

like image 393
Steephan Selvaraj Avatar asked Mar 02 '18 08:03

Steephan Selvaraj


People also ask

Why are the size of flutter apps so big?

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.

How do I reduce the size of a project flutter?

Get into Your_project\build\app\outputs\flutter-apk\app-release. apk Choose the app-release. apk , this file size will be smaller now.

What is the size of flutter app?

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.


1 Answers

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

like image 95
Canaan Etai Avatar answered Oct 13 '22 04:10

Canaan Etai