尽管我添加了“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/