Home > OS >  How to reduce app size in flutter android app?
How to reduce app size in flutter android app?

Time:02-04

**Is there any way i can reduce app size in this flutter app **

Can anyone tell me how do I reduce this apk size? Some major contributors are , Dart AOT symbols(5MB) The same applicative using native android can be built in just 4-5MB

Here are the results of --analyze-size.

√  Built build\app\outputs\flutter-apk\app-release.apk (8.5MB).
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
app-release.apk (total compressed)                                          8 MB
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  assets/
    flutter_assets                                                          1 MB
  com/
    google                                                                210 KB
  res/
    mipmap-xxxhdpi-v4                                                       1 KB
  META-INF/
    kotlin-stdlib.kotlin_module                                             3 KB
    kotlinx-coroutines-core.kotlin_module                                   1 KB
    CERT.SF                                                                33 KB
    CERT.RSA                                                              1016 B
    MANIFEST.MF                                                            31 KB
  kotlin/
    kotlin.kotlin_builtins                                                  4 KB
    reflect                                                                 1 KB
    collections                                                             1 KB
  AndroidManifest.xml                                                       1 KB
  classes.dex                                                             325 KB
  resources.arsc                                                           24 KB
  lib/
    arm64-v8a                                                               6 MB
    Dart AOT symbols accounted decompressed size                            5 MB
      package:flutter                                                       3 MB
      package:intl_phone_number_input                                     277 KB
      dart:core                                                           268 KB
      dart:typed_data                                                     213 KB
      dart:ui                                                             206 KB
      dart:io                                                             151 KB
      dart:collection                                                     142 KB
      package:flutter_svg                                                 120 KB
      dart:async                                                          119 KB
      package:hoteljobber_employer                                         99 KB
      dart:convert                                                         60 KB
      package:vector_math                                                  54 KB
      package:petitparser                                                  50 KB
      package:xml                                                          38 KB
      package:dropdown_search                                              37 KB
      package:characters                                                   32 KB
      dart:isolate                                                         29 KB
      package:path_parsing/
        src                                                                16 KB
      package:collection/
        src                                                                16 KB
      dart:ffi                                                             12 KB
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
A summary of your APK analysis can be found at: C:\Users\DELL\.flutter-devtools\apk-code-size-analysis_04.json

CodePudding user response:

use state management in your app which will reduce the size of your app. and build through your terminal using this command: flutter build app --split-per-abi

CodePudding user response:

You could build a release apk using the command:

flutter build apk --release --split-per-abi

You could also get reduce apk size by:

  • Removing unused resources
  • Minimizing resources imported from libraries
  • Compressing PNG and JPEG files

find more resources on how to reduce apk size from the official documentation here

CodePudding user response:

Build with: flutter build apk --split-per-abi

  •  Tags:  
  • Related