APK文件20MB正常吗?

Is 20MB normal for an APK file?

我为我的项目制作了.apk文件,它的大小是19.4MB,这正常吗? 我使用了命令:

flutter build apk --release 该命令确实会生成 apk 文件,但会输出此消息:

You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split

20MB 是正常大小,但您应用程序的大部分大小是由 android-arm、android-arm64 和 android-x64 的二进制文件贡献的。 在特定设备中,根据设备硬件,即设备的 abi,​​将仅使用一个二进制文件。

推荐使用 app bundle,因为 Google 会自动为每个 abi 创建 APK,从而减少应用程序的大小。

例如 Play 商店将为 android-arm、android-arm64 和 android-x64 ABI 创建单独的 apk。

是的,apk 文件是正常的。您已经为 x64 、 arm 等多进程支持构建了二进制文件。这就是为什么 size 在您的情况下更大。但它不会产生任何问题。您可以通过仅为目标平台构建二进制文件来减小 apk 的大小 运行 您的应用程序。