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

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

问题描述

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

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?

警告消息:

推荐答案

Edit/Update: Google已在稳定的渠道中发布了Flutter 1.7.8 + hotfix.3,可轻松构建要发布的应用程序.

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. 应用捆绑包(首选)
  2. APK

生成应用捆绑包

Generating App Bundle

运行flutter build appbundle

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

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

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).

现在您可以将此应用捆绑包上传到Google Play.

Now you can upload this app bundle to google play.

构建APK

Build an APK

flutter build apk --split-per-abi

此命令产生两个APK文件:

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

删除--split-per-abi标志会生成一个胖APK,其中包含为所有目标ABI编译的代码.此类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.

如果您尚未升级到Flutter 1.7,则以下解决方案仍应 工作.

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

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

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

这对我有效的我是flutter v1.5.4-hotfix.2

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

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

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

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

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

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

上传此新apk并开始推出.

Upload this new apk and start rollout.

祝你好运

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

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