Search code examples
flutterandroid-app-bundleflutter-build

What is the difference between flutter build bundle and appbundle in flutter?


I find little to no information on what's the difference between these two

flutter build bundle
flutter build appbundle

When should I use one over the other?


Solution

  • flutter build appbundle
    

    builds the 'app bundle' that is uploaded to the Google Play store. The app bundle is basically a bundle of apk files. When a user installs your app, Google Play will serve the optimal apk to the device. The app bundle is compressed into a aab file (Android app bundle).

    flutter build bundle 
    

    builds a special 'app bundle' archive from the list of assets in your pubspec.yaml that your app can read from at runtime. The builder places this in the flutter_assets folder in the build directory.

    So basically they build different stuff. flutter build appbundle is pretty much unavoidable if you're building an app for release on the Play Store.

    However, I have never needed to use flutter build bundle. I have never needed to build an individual assets folder as it's incorporated within an appbundle build.