App size affects installs: a large download is one more reason to tap away from your store page, especially on mobile data. Flutter apps start larger than a minimal native app because they ship the engine, but most of the extra weight in real projects comes from things you control: assets, packages and debug info.
The method is simple: measure the right build, find the biggest pieces, cut them, measure again. This post covers each step on iOS and Android. It is part of building a Flutter app with Claude Code.
Step 1: stop measuring debug builds
Flutter’s docs are blunt: the size of a debug build “is large due to the debugging overhead that allows for hot reload and source-level debugging. As such, it is not representative of a production app end users download.”
So never judge size from flutter run output. Always build release:
flutter build appbundle
flutter build ipa
And remember the file you build is not what users download. On Android, Google Play takes your bundle and generates “optimized APKs for each device configuration, so only the code and resources that are needed for a specific device are downloaded.” On iOS, the store also thins the app per device.
Step 2: see what is inside
Flutter has a built-in size analysis:
flutter build appbundle --analyze-size
flutter build ios --analyze-size
This build compiles Dart in a way that “records code size usage of Dart packages,” prints a summary in the terminal, and leaves a *-code-size-analysis_*.json file. Open it in DevTools:
dart devtools
Choose “Open app size tool” and load the JSON. You get a tree or treemap down to individual files and functions in the Dart code. You can also load two files to compare builds, which is how you check whether a change actually helped.
Look for three things in the treemap:
- Assets that are bigger than they need to be.
- Packages you barely use but ship in full.
- Native libraries pulled in by plugins.
Step 3: split out debug info
The biggest code win for most apps is one flag. Flutter’s size guide: “When building a release version of your app, consider using the --split-debug-info tag. This tag can dramatically reduce code size.”
flutter build appbundle --obfuscate --split-debug-info=build/symbols
flutter build ipa --obfuscate --split-debug-info=build/symbols
--split-debug-info writes the symbols files to the folder you name. --obfuscate renames symbols to more obscure names; Flutter’s obfuscation guide uses the two flags together.
Keep the symbols folder for every release. Without it you cannot read crash stack traces. Flutter’s tool for that is:
flutter symbolize -i <stack-trace-file> -d build/symbols/app.android-arm64.symbols
And upload them to Crashlytics so crash reports stay readable (see Flutter Firebase Crashlytics setup).
Know the limits of obfuscation, from Flutter’s docs: it “does not encrypt resources nor does it protect against reverse engineering. It only renames symbols.” The guide also warns that “Code that relies on matching specific class, function, or library names will fail,” such as comparing runtimeType.toString() to a class name. Never store secrets in the app either way. See the mobile app security checklist.
Step 4: ship an app bundle on Android
Flutter’s Android guide: “The Google Play Store prefers the app bundle format,” and its FAQ says Play recommends bundles over APKs “because they allow a more efficient delivery of the application to your users.” New Play apps must use the Android App Bundle anyway.
If you ever distribute APKs outside Play, do not ship the “fat” APK. Use:
flutter build apk --split-per-abi
This produces one APK per ABI (armeabi-v7a, arm64-v8a, x86_64) instead of one APK containing code for all of them.
Code shrinking with R8 is on for release builds by default, per Flutter’s docs, so there is no flag to add. If you have disabled it at some point, turn it back on.
Step 5: cut assets
Assets are often the largest thing you control. Flutter’s list of other size fixes is short:
- “Remove unused resources”
- “Minimize resource imported from libraries”
- “Compress PNG and JPEG files”
In practice:
- Images. Export at the largest size you actually display, not the designer’s master. Prefer vector (SVG via a package, or icon fonts) for icons and simple illustrations. Compress photos.
- Fonts. Ship only the weights you use. A full family with every weight and italic adds up fast.
- Animations and video. Large Lottie files and bundled videos are common culprits. Consider downloading them on first use if they are not needed on launch.
- Old assets. Search for each file in
pubspec.yamland check it is still referenced in code. - Flavor-only assets. Debug images or test fixtures can be limited to the dev flavor with the
flavors:key inpubspec.yaml. See Flutter flavors for dev and prod.
Step 6: audit packages
Each plugin can bring native SDKs on both platforms. Review pubspec.yaml with the DevTools treemap open:
- Remove packages you added for one small helper and write the helper instead.
- Avoid two packages that do the same job (two HTTP clients, two image caches).
- Check heavy native SDKs (ads, analytics suites, maps) and include only the ones the app really uses.
Flutter’s docs add one more code tip: the Dart compiler drops code that is unreachable on the target platform, so wrapping platform-specific code in checks like Platform.isIOS lets it be stripped from the other build.
Step 7: measure iOS the right way
The .ipa on your disk is not the download size. Flutter’s docs: “To measure an iOS app exactly, you have to upload a release IPA to Apple’s App Store Connect and obtain the size report from there.”
For a quicker local estimate, sign and export the IPA from Xcode; the export folder contains App Thinning Size Report.txt “with details about your projected application size on different devices and versions of iOS.” The build steps are in Flutter build IPA for the App Store.
Apple also sets hard ceilings: for iOS 9.0 and later, its maximum build file size table lists 4 GB, with 500 MB for the total of the binary’s __TEXT sections. Few Flutter apps get near that, but it is the line that causes an upload error.
A repeatable routine
- Build release with
--analyze-sizeand save the JSON. - Make one change: compress images, drop a package, add
--split-debug-info. - Rebuild and compare the two JSON files in DevTools.
- Before each release, check the App Store Connect size report and the Play Console’s Android vitals App size tab for any jump.
Run it in CI so a 10 MB asset added by accident shows up in review, not in your store listing. See Flutter CI/CD for App Store and Play, and put a size check in your mobile app QA checklist.
MobileKit’s build standards include the release flags and asset rules above, so new projects start small.
Sources read on the day this post was written: Flutter: Measuring your app’s size, Flutter: Obfuscating Dart code, Flutter: Build and release an Android app, Android: About Android App Bundles and App Store Connect: Maximum build file sizes.