如何构建符合Google Play 64位要求的应用程序?

Xih*_*uny 24 android dart flutter

将apk上传到Play商店后,收到以下警告。我应该做出哪些更改才能发布带有fld sdk的apk版本以满足64位要求?

查看图像以查看警告消息。

https://pasteboard.co/Id8Vqoi.png

C4C*_*C4C 21

Edit/Update: Google has released Flutter 1.7.8+hotfix.3 in stable channel, which makes easy to build 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
Run Code Online (Sandbox Code Playgroud)

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
Run Code Online (Sandbox Code Playgroud)

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 it 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
Run Code Online (Sandbox Code Playgroud)

Upload this new apk and start rollout.

Good luck


Dha*_*ngh 12

伙计们,他们改变了新的64-bit建筑政策。所以请把这段代码放在你的gradle中

ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
Run Code Online (Sandbox Code Playgroud)

例如

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.test.test"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
}
Run Code Online (Sandbox Code Playgroud)

  • 有没有不使用flutter的解决方案? (3认同)