此版本与Google Play 64位要求不兼容,对本机android有反应

问题描述 投票:0回答:1

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

错误此版本不符合Google Play 64位要求以下APK或应用捆绑包可用于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个回答
0
投票

添加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
            }
        }
    }
}
    ...
© www.soinside.com 2019 - 2024. All rights reserved.