虽然我添加了“ x86”,“ x86_64”,“ armeabi-v7a”,“ arm64-v8a”,但在游戏商店上载aab时仍然出现以下错误,但我仍然收到此错误
此版本不符合Google Play 64位要求
以下APK或应用捆绑包可用于64位设备,但它们仅具有32位本机代码:2。
答案 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位代码。