首页 > 解决方案 > appbundle 颤振应用程序的 64 位显示停止器错误

问题描述

我正在尝试将我们的颤振应用程序发布到谷歌游戏商店,我得到了似乎是一个显示停止错误的东西......

错误

此版本不符合 Google Play 64 位要求

以下 APK 或 App Bundle 可用于 64 位设备,但它们只有 32 位本机代码: 3.

在您的应用程序中包含 64 位和 32 位本机代码。使用 Android App Bundle 发布格式自动确保每个设备架构只接收它需要的本机代码。这样可以避免增加应用程序的整体大小。 学到更多

有谁知道如何解决这一问题?当我用谷歌搜索这个错误时,我什么也没看到。我们只是想在那里进行封闭式 Alpha 测试。

标签: flutterdartgoogle-play-console

解决方案


我终于可以通过将它添加到 build.gradle 来解决这个问题

  ndk {
        abiFilters  "armeabi-v7a", "arm64-v8a"
    }
}

splits {
    abi {
        include  "armeabi-v7a", "arm64-v8a"
    }
 }
 applicationVariants.all { variant ->
    variant.outputs.each { output ->
        // For each separate APK per architecture, set a unique version code as described here:
        // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
        def versionCodes = ["armeabi-v7a":1, "arm64-v8a":2]
        def abi = output.getFilter(OutputFile.ABI)
        if (abi != null) {  // null for the universal-debug, universal-release variants
            output.versionCodeOverride =
                    versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
        }
    }
 }

推荐阅读