此版本不符合Google Play 64位要求的React Native应用

时间:2020-01-07 14:15:19

标签: reactjs react-native google-play

虽然我添加了“ x86”,“ x86_64”,“ armeabi-v7a”,“ arm64-v8a”,但在游戏商店上载aab时仍然出现以下错误,但我仍然收到此错误

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

以下APK或应用捆绑包可用于64位设备,但它们仅具有32位本机代码:2。

enter image description here

1 个答案:

答案 0 :(得分:1)

检查您的android/app/build.gradle文件,并确保您具有以下几行:

...
android {
  defaultConfig {
    // If you are using 'ndk'
    ndk {
        abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
    }
  }
  splits {
    abi {
      include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
    }
  }
  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, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
        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
        }
      }
    }
}

您必须添加"arm64-v8a", "x86_64"才能使apk包含64位代码。

有关更多详细信息,请查看以下两篇文章:article1 article2