我已经为我的项目制作了.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发布于 2020-06-06 01:20:45
20MB是一个正常的大小,但你的应用程序的大部分大小是由android-arm、android-arm64和android-x64的二进制文件贡献的。在特定设备中,根据设备硬件,即设备的abi,仅使用其中一个二进制文件。
建议使用app bundle,因为Google会自动为每个abi创建APK,从而减少app的大小。
例如,Play Store将为android-arm、android-arm64和android-x64ABI创建单独apk。
发布于 2020-06-06 01:26:21
是的,这对于apk文件来说是正常的。您已经为多进程支持构建了二进制文件,如x64、arm等,这就是为什么在您的情况下大小更大的原因。但它不会产生任何问题。你可以通过只为你想要运行你的应用程序的目标平台构建二进制文件来减少你的apk的大小。
https://stackoverflow.com/questions/62220745
复制相似问题