Flutter apps are too big in size

Steephan Selvaraj :

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?

Vilokan Labs :

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.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=427591&siteId=1