How I Cut My App’s Build Size by 50% in Flutter

Software Engineer | Content Creator
Search for a command to run...

Software Engineer | Content Creator
No comments yet. Be the first to comment.
Flutter makes it easy to build beautiful cross-platform applications, but security is often overlooked until it's too late. Whether you're building a small personal project or a large-scale production

In modern mobile applications, providing a seamless user experience even with poor or no network connectivity is crucial. This article demonstrates how to implement a robust caching mechanism for API

Flutter is one of the fastest-growing cross-platform UI toolkits. But as your app grows, it can suffer from lag, jank, and memory bloat if you're not mindful of performance. Whether you're building for Android, iOS, or web, performance matters. In th...

Google introduced the Photo Picker in Android 13 to make photo and video selection easier and more secure. It allows users to select media files directly from their device’s library, and the best part is it offers better privacy by letting users shar...

Build size is one of the most critical aspects of mobile app development, especially if you're targeting users in regions with limited internet access or data caps. Recently, I managed to reduce my Flutter app’s release build size by nearly 50%, and in this post, I’ll share exactly how I did it — step by step.
A bloated app build not only takes longer to download but can also impact your app’s install rate and even ranking on app stores. Optimizing your app size leads to:
Faster downloads
Lower storage usage
Better performance on low-end devices
Improved user experience
To start, I ran the following command to analyze my app's current size:
flutter build apk --analyze-size
This generated a .json file I could open in the Flutter DevTools size analyzer.
Initial APK size: 36.2 MB
After optimizations: 18.1 MB
Let’s break down the optimizations I applied.
I checked my pubspec.yaml and removed unused dependencies:
# Before
dependencies:
http:
provider:
firebase_analytics:
charts_flutter:
flutter_html:
I removed charts_flutter and flutter_html, which were not in active use. Then ran:
flutter pub get
Savings: ~2.5 MB
If you're using MaterialIcons, Flutter includes the whole icon set by default.
To fix this, I used flutter_launcher_icons and custom icon fonts instead of importing the entire icon library.
Also, add this in pubspec.yaml:
flutter:
uses-material-design: false
Savings: ~1.8 MB
Instead of generating a fat APK that supports all architectures, I created APKs per ABI:
flutter build apk --split-per-abi
This gave me separate APKs for armeabi-v7a, arm64-v8a, and x86_64.
Savings: Up to 60% for specific architectures
I had several high-res images in the assets folder. I:
Compressed PNGs using TinyPNG
Resized large images
Used WebP format where possible
Savings: ~3.2 MB
ProGuard helps strip unused code from dependencies. I enabled it by editing android/app/build.gradle:
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Savings: ~4 MB
Always build with the --release flag and ensure no debug info is bundled.
flutter build apk --release
Also, avoid logging in production builds.
Flutter now supports deferred components (Android only), letting you load parts of the app on demand. This requires setup on both the Flutter and Android side.
More here: Flutter Deferred Components
Cutting down your Flutter app's build size doesn't have to be rocket science. Start with an analysis, then iterate through removal of unused packages, asset optimization, ABI splitting, and enabling ProGuard.
Total size saved: ~18 MB (50%)
If your users are in bandwidth-sensitive markets, this can make a huge difference in adoption and retention.
Have you tried optimizing your Flutter app size? Got any other tricks up your sleeve? Let me know in the comments or connect with me.