← Back to posts Cover image for Demystifying Flutter App Size: Strategies to Reduce APK/App Bundle Bloat on Google Play

Demystifying Flutter App Size: Strategies to Reduce APK/App Bundle Bloat on Google Play

· 5 min read
Weekly Digest

The Flutter news you actually need

No spam, ever. Unsubscribe in one click.

Chris
By Chris

Why Your Flutter App is Heavier Than You Think

You’ve built a sleek, efficient Flutter app. Your code is clean, your widgets are optimized. Yet, when you upload it to Google Play, the reported download size feels massive—sometimes staying stubbornly large even after minor updates. This isn’t just a vanity metric; a large app size directly impacts user acquisition. Studies show higher download abandonment rates as app size grows. So, why is your APK or App Bundle so bloated, and what can you do about it?

The core issue often lies not in your Dart code, but in the underlying packaging and resources. Flutter’s power comes from its engine and framework, which add a baseline size. However, common development practices can unintentionally inflate this baseline significantly.

Common Culprits of App Bloat

  1. The WebView Tax: Including the webview_flutter plugin is a frequent offender. It adds a standalone WebView component, which can increase your app’s size by 10 MB or more because it bundles the necessary rendering engine. Ask yourself: is a full WebView essential, or could a deep link or a custom UI suffice?
  2. Multi-Architecture Bundles (The “Multi-APK” Effect): When you build a release APK (flutter build apk --release), it defaults to containing compiled libraries for both armeabi-v7a (32-bit) and arm64-v8a (64-bit) device architectures. This is convenient but duplicates native code. A user’s device only needs one set, so you’re making them download both.
  3. Unoptimized Assets: High-resolution images, uncompressed audio files, and unused fonts bundled in your assets folder are included in full. A single full-screen PNG can easily be several megabytes.
  4. Unused Packages & Native Code: Plugins often bring along their own native (Java/Kotlin, Obj-C/Swift) code and libraries. If you’ve experimented with a package and removed its Dart imports, its native components might still be lurking in your build.

Actionable Strategies to Trim the Fat

1. Use App Bundles and Split Per Architecture

The single most effective change is to stop uploading APKs directly to Google Play. Instead, use Android App Bundles (.aab). Google Play then generates optimized, device-specific APKs (a process called “split APKs”) that contain only the necessary code and resources for each user’s device.

Build your App Bundle:

flutter build appbundle

For even finer control, you can instruct Flutter to build split APKs per ABI (Application Binary Interface) for local testing:

flutter build apk --split-per-abi

This command creates separate APKs (e.g., app-armeabi-v7a-release.apk, app-arm64-v8a-release.apk), each much smaller than the universal APK.

2. Analyze Your Bundle

Before optimizing, you need to see what’s inside. Use the flutter pub deps command to audit dependencies. For a detailed visual breakdown of your app’s size, generate an analysis report:

flutter build apk --target-platform android-arm64 --analyze-size

Or, for a more detailed DevTools-compatible file:

flutter build appbundle --target-platform android-arm64 --analyze-size

Then, open DevTools and load the generated *-code-size-analysis_*.json file in the “App Size” tool. This will show you exactly which Dart packages and assets are contributing the most to your size.

3. Optimize Assets Relentlessly

  • Compress Images: Use tools like pngcrush, ImageOptim, or tinypng.com. Consider using the flutter_image_compress package to handle compression programmatically if you have user-uploaded content.
  • Remove Unused Assets: Do a periodic audit of your pubspec.yaml. An asset listed there is included in the bundle.
  • Use the Right Format: For simple graphics, consider SVG (using flutter_svg). For photos, modern formats like WebP offer superior compression. You can easily convert assets during build.

4. Prune Unnecessary Packages

Review your pubspec.yaml. Remove any package you aren’t actively using. Pay special attention to large plugins with native dependencies (like video players, advanced sensors, or—as mentioned—WebViews). Check if a lighter-weight alternative exists.

5. Enable Code Shrinking and Obfuscation

Ensure your release build is stripping unused code. In your android/app/build.gradle file, confirm the following is set in your buildTypes for release:

buildTypes {
    release {
        signingConfig signingConfigs.release
        // Ensure these are true:
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

Then, run flutter build appbundle --obfuscate --split-debug-info=./<output-directory>. This tells the Dart compiler to tree-shake (remove unused code) and obfuscate your Dart symbols, which also slightly reduces size.

Final Checklist Before Upload

  1. ✅ Build with flutter build appbundle.
  2. ✅ Run a size analysis to identify your largest components.
  3. ✅ Compress all images and use WebP where possible.
  4. ✅ Remove any asset or font not directly used.
  5. ✅ Audit and remove unused packages from pubspec.yaml.
  6. ✅ Verify code obfuscation and shrinking are enabled.

By adopting these strategies, you can often reduce your app’s download size by 30-50% or more. It transforms your app from a hefty download into a lean, user-friendly package, improving first impressions and install rates. Start with the App Bundle and asset optimization—you’ll likely see a dramatic difference immediately.

This blog is produced with the assistance of AI by a human editor. Learn more

Related Posts

Cover image for Flutter's Hidden Gem: Building Powerful Linux Desktop Apps with Ease

Flutter's Hidden Gem: Building Powerful Linux Desktop Apps with Ease

Flutter is gaining traction as a robust framework for Linux desktop development, offering a smoother experience compared to traditional toolkits like GTK and Qt. This post will explore why Flutter excels for Linux apps, highlight its advantages, and provide practical insights for developers looking to leverage Flutter for their desktop projects.

Cover image for Simplifying Flutter Desktop Deployment: Signing and Distribution for Windows

Simplifying Flutter Desktop Deployment: Signing and Distribution for Windows

Deploying Flutter desktop apps on Windows can be challenging, especially regarding code signing and preventing Windows from blocking installations. This post will guide developers through the process of signing their Flutter desktop applications, exploring alternatives to the Microsoft Store like creating executable installers, and covering the necessary steps to ensure a smooth user experience.

Cover image for Mastering Flutter Tooling: Streamlining SDK Management and Installation on Windows

Mastering Flutter Tooling: Streamlining SDK Management and Installation on Windows

Developers frequently voice frustrations about Flutter SDK version management and installation processes, particularly on Windows. This post will explore best practices for managing multiple Flutter versions using tools like FVM, discuss integrating Flutter with package managers like Winget for a smoother Windows setup, and offer strategies to ensure a consistent development environment across projects and teams.