Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
517 views
in Technique[技术] by (71.8m points)

android - How to build app compliant with Google Play 64-bit requirement?

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: enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...