如何构建符合 Google Play 64 位要求的应用程序? [英] How to build app compliant with Google Play 64-bit requirement?

查看:19
本文介绍了如何构建符合 Google Play 64 位要求的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我将 APK 上传到 Play 商店后,我收到以下警告.为了满足 64 位要求,我应该进行哪些更改才能发布带有 Flutter SDK 的 APK 构建版本?

警告信息:

解决方案

Edit/Update: Google 在稳定频道发布了 Flutter 1.7.8+hotfix.3,这使得构建应用变得容易释放.

现在您有两个构建选项:

  1. 应用程序包(首选)
  2. APK

<块引用>

生成应用程序包

运行flutter build appbundle

这将创建 /build/app/outputs/bundle/release/app.aab

T 应用程序包包含您的 Dart 代码和为 armeabi-v7a(32 位)arm64-v8a(64 位) 编译的 Flutter 运行时.

现在您可以将此应用程序包上传到 google play.

<块引用>

构建 APK

flutter build apk --split-per-abi

此命令会生成两个 APK 文件:

/build/app/outputs/apk/release/app-armeabi-v7a-release.apk<应用程序目录>/build/app/outputs/apk/release/app-arm64-v8a-release.apk

删除 --split-per-abi 标志会生成一个包含为所有目标 ABI 编译的代码的胖 APK.此类 APK 的大小比拆分的 APK 大,导致用户下载不适用于其设备架构的本机二进制文件.

<块引用>

如果你还没有升级到 flutter 1.7 下面的解决方案应该还是工作.

您需要构建两个apk并一起上传.一个用于 32 位,另一个用于 64 位.

这对我有用我在 flutter v1.5.4-hotfix.2 上

首先运行flutter build apk --release并上传apk文件

然后在pubspec.yml文件中增加版本和构建号并运行

flutter build apk --release --target-platform=android-arm64

上传这个新的 apk 并开始发布.

祝你好运

After I upload the APK to play store I got the following warning. What changes should I make to release an APK build with flutter SDK to meet the 64-bit requirement?

The warning message:

解决方案

Edit/Update: Google has released Flutter 1.7.8+hotfix.3 in stable channel, which makes easy to build an app for release.

Now you have two options to build :

  1. App bundle (preferred)
  2. APK

Generating App Bundle

Run flutter build appbundle

This will create <app dir>/build/app/outputs/bundle/release/app.aab

T app bundle contains your Dart code and the Flutter runtime compiled for armeabi-v7a (32-bit) and arm64-v8a (64-bit).

Now you can upload this app bundle to google play.

Build an APK

flutter build apk --split-per-abi

This command results in two APK files:

<app dir>/build/app/outputs/apk/release/app-armeabi-v7a-release.apk
<app dir>/build/app/outputs/apk/release/app-arm64-v8a-release.apk

Removing the --split-per-abi flag results in a fat APK that contains your code compiled for all the target ABIs. Such APKs are larger in size than their split counterparts, causing the user to download native binaries that are not applicable to their device’s architecture.

If you haven't upgraded to flutter 1.7 Below solution should still work.

You need to build two apk and upload them together. one for 32 and another for 64 bit.

This is what worked for me I am on flutter v1.5.4-hotfix.2

First, run flutter build apk --release and upload the apk file

Then increase the version and build number in pubspec.yml file and run

flutter build apk --release --target-platform=android-arm64

Upload this new apk and start rollout.

Good luck

这篇关于如何构建符合 Google Play 64 位要求的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆