【问题标题】:What is the difference between flutter build bundle and appbundle in flutter?Flutter中的flutter build bundle和appbundle有什么区别?
【发布时间】:2021-09-06 02:10:56
【问题描述】:

我几乎找不到关于这两者之间有什么区别的信息

flutter build bundle
flutter build appbundle

我应该什么时候使用一个而不是另一个?

【问题讨论】:

    标签: flutter android-app-bundle flutter-build


    【解决方案1】:
    flutter build appbundle
    

    构建上传到 Google Play 商店的“应用程序包”。应用程序包基本上是一组apk 文件。当用户安装您的应用时,Google Play 会为设备提供最佳的apk。 app bundle 被压缩成一个aab 文件(Android app bundle)。

    flutter build bundle 
    

    从您的 pubspec.yaml 中的资产列表构建一个特殊的“应用程序包”存档,您的应用可以在运行时读取该存档。构建器将其放置在build 目录中的flutter_assets 文件夹中。

    所以基本上他们构建不同的东西。 flutter build appbundle 几乎是不可避免的,如果您正在构建一个应用程序以在 Play 商店上发布。

    但是,我从来不需要使用flutter build bundle。我从来不需要构建单独的资产文件夹,因为它已包含在 appbundle 构建中。

    【讨论】:

    • 谢谢。我们在 CI 环境中使用flutter build bundle,但我不知道为什么。对我来说,在 CI 中构建实际的应用程序是有意义的,而不仅仅是资产目录(这需要大约 30 秒而不是 4 分钟)。感谢您确认我对这个令人困惑且无证的话题的怀疑!
    • 没有问题。并感谢您的回复(这么多人不打扰)
    猜你喜欢
    • 2022-12-14
    • 2023-01-26
    • 2022-01-13
    • 2021-04-15
    • 2020-07-17
    • 2020-09-20
    • 2019-06-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多