skip to Main Content

Currently I am building an apk from the terminal. The build end size shows 24.9MB. But when I open in build folder in Explorer it shows 56.9MB.

Steps used:

  • flutter clean
  • flutter build apk

enter image description here

enter image description here

Usually, the build size in the terminal will be the same as in Explorer. But now it shows double the size in Explorer. Please help.

2

Answers


  1. Flutter builds two types of APKs: debug and release. The release APK, found in build/app/outputs/flutter-apk/app-release.apk, is smaller and optimized for production. The debug APK, the one displayed in file explorers, is larger due to features like hot reload and is intended for development and testing, not distribution.

    check your release apk in the

    build/app/outputs/flutter-apk/app-release.apk
    

    or you can CTRL+click on the path in terminal and it will open that path in file explorer for you.

    The app 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.

    Login or Signup to reply.
  2. For the final release you can use the following command to generate APK or appbundle for release.

    Appbundle:

    flutter build appbundle --no-tree-shake-icons --target-platform android-arm,android-arm64,android-x64 --release
    

    APK:

    flutter build apk --no-tree-shake-icons --target-platform android-arm,android-arm64,android-x64 --release
    

    The size of your application release decrease when it goes live in play store.

    Read documentation: https://docs.flutter.dev/perf/app-size

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search