【问题标题】:This release is not compliant with the Google Play 64-bit requirement react native android此版本不符合 Google Play 64 位要求 react native android
【发布时间】:2020-03-07 01:40:29
【问题描述】:

我已经将我的 React 本机版本 0.57.1​​ 升级到 0.59.1 并修复了所有库问题。成功构建后,我将 .aap 文件上传到播放商店,但出现以下错误:

错误 此版本不符合 Google Play 64 位要求 以下 APK 或 App Bundle 可用于 64 位设备,但它们只有 32 位本机代码:21。 在您的应用程序中包含 64 位和 32 位本机代码。使用 Android App Bundle 发布格式自动确保每个设备架构只接收它需要的本机代码。这样可以避免增加应用的整体大小。

如果有人能解决这个问题,请告诉我谢谢!

这是我的 build.gradle

buildscript {
    ext {
      buildToolsVersion = "28.0.3"
      minSdkVersion = 19
      compileSdkVersion = 28
      targetSdkVersion = 28
      supportLibVersion = "1.0.0-beta01"
      googlePlayServicesAuthVersion = "17.0.0"
    }

package.json

"react": "16.8.3",
"react-native": "^0.59.1",

【问题讨论】:

    标签: react-native google-play react-native-android


    【解决方案1】:

    添加 abi 过滤器(“arm64-v8a”和“x86-64”)

    android {
        ...   
    
        splits {
            abi {
                reset()
                enable enableSeparateBuildPerCPUArchitecture
                universalApk false
                include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
            }
        }
        // In case, if you're using `ndk`
        defaultConfig {
            ndk {
                // Tells Gradle to build outputs for the following ABIs and package
                // them into your APK.
                abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
            }
        }
        applicationVariants.all { variant ->
            variant.outputs.each { output ->
                def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
                def abi = output.getFilter(OutputFile.ABI)
                if (abi != null) { 
                    output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
                }
            }
        }
    }
        ...
    

    【讨论】:

      猜你喜欢
      • 2020-01-24
      • 2019-12-22
      • 1970-01-01
      • 2020-04-25
      • 2019-09-25
      • 1970-01-01
      • 2020-10-27
      • 2020-08-02
      • 2020-05-23
      相关资源
      最近更新 更多