reactjs - 此版本不符合 Google Play 64 位要求 React Native 应用程序

标签 reactjs react-native google-play

尽管我添加了“x86”、“x86_64”、“armeabi-v7a”、“arm64-v8a”,但在 Play 商店上传 aab 时仍然出现以下错误

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

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

enter image description here

最佳答案

检查您的 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

关于reactjs - 此版本不符合 Google Play 64 位要求 React Native 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59630164/

相关文章:

reactjs - "shouldComponentUpdate"是否在服务器上运行?

javascript - React-Redux-从列表中删除项目

react-native - 在 React Native 中将状态从子组件传递到父组件

android - 启用 Google Play App Signing 后 Gmail 登录不起作用

reactjs - 如何在 JSX 中制作图像按钮?

javascript - 从子到子的访问方法

react-native - 如何更改占位符颜色 React Native RNPickerSelect

javascript - React Native 中的椭圆曲线密码学

google-play - Unity无法将类转换为dex格式

Android SQLite 数据库问题