Android app size after Flutter module integration
App size increase is always the biggest concern for a firm.
The larger the app size, higher the chance of the app getting uninstalled or download failure. Same was for us. So, we decided for a depth Analysis to see what will be actual size after flutter module integration.
For Integration of Flutter to android. Kindly go through the official site Add Flutter to existing app.
Flutter has three build modes
- debug
- profile
- release
where creating a release apk will lead to the most optimized size.
More on flutter build mode Flutter’s build modes
I have a production android App. Let's call it AliceApp.
Now, I have integrated a single-page flutter module into the app. Let's call it AliceFlutterApp.
When I created a signed release build of AliceApp it is 14.5 MB.
When I created a signed release build of AliceFlutterApp it is 30.3 MB.
Oh! such a huge increase.
When we dig a bit deep by analyzing both apk.
AliceApp.apk
AliceFlutterApp.apk
What we found,
An extra lib folder is added and it is contributing 15.7 MB.
This consists of a flutter engine for 3 supported architectures by flutter.
The Flutter Engine is a portable runtime for hosting Flutter applications. It implements Flutter’s core libraries, including animation and graphics, file and network I/O, accessibility support, plugin architecture, and a Dart runtime and compile toolchain.
Since we are generating a combined APK. Thus, we have all 3 flutter engines present with us. But when we upload this as an android app bundle on the play store. While downloading, users will get one of them depending on the phone-supported architecture.
You can check How big is flutter engine here(FAQ ).
The flutter team knows this fact(Too big size for empty APK (engine disk footprint size) · Issue #12456 · flutter/flutter ).
Wait!🛑
Just 3 architectures are supported.
Your existing Android app may support architectures such as MIPS or x86. Flutter currently only supports building ahead-of-time (AOT) compiled libraries for x86_64, armeabi-v7a, and arm64-v8a.
This can lead to the loss of customers who are on x86. But still not a huge number.
· ARMv7: 98.1%
· Intel x86: 1.7%
If your app supports armeabi-v7a and arm64-v8a architectures. They cover around 99% of Android devices.
More on this % distribution
Experiment result
When we created a bundle for both apps and distributed it through the play store. The AliceApp size was 14.60 MB.
The size of the AliceFlutterApp was 27.30 MB.
An increase of 12.70 MB occurred.
That's all about the analysis of Android App size increase.
Hope! this helps you somewhere in your journey.
Please share some love by commenting if you find something, not in your favor. 🧚🏼