【发布时间】:2020-05-03 12:13:59
【问题描述】:
当我尝试将应用程序放入谷歌商店时,我看到了这个:
此版本不符合 Google Play 64 位要求
以下 APK 或 App Bundle 可用于 64 位设备,但它们只有 32 位本机代码。我只有 32 位本机代码,我在 build gradle 上执行此操作:
从 2019 年 8 月 1 日起,所有版本都必须符合 Google Play 64 位要求。
在您的应用中包含 64 位和 32 位本机代码。使用 Android App Bundle 发布格式自动确保每个设备架构只接收它需要的本机代码。这样可以避免增加应用的整体大小。
ndk {
moduleName "***"
abiFilters "armeabi", "armeabi-v7a", "x86_64", "mips",'arm64-v8a'
}
task nativeLibsToJar(type: Jar, description: 'create a jar archive of the native libs') {
destinationDir file("$buildDir/native-libs")
baseName 'native-libs'
from fileTree(dir: 'libs', include: '**/*.so')
into 'lib/'
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
}
splits {
abi {
include "armeabi-v7a", "arm64-v8a"
}
}
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, "arm64-v8a":2]
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
}
}
}
但我无法在 google store 上添加 apk
编辑
编辑
[![在此处输入图片描述][3]][3]
编辑 [![在此处输入图片描述][4]][4]
【问题讨论】:
-
不要使用APK上传到play store,使用AAB
-
@Hooman abiFilters "armeabi", "armeabi-v7a", "x86_64", "mips",'arm64-v8a' , 'x64' 这个?
-
@MichaelStoddart 但偷我不能上传 apk
-
所以改为上传 AAB!
标签: android android-ndk android-build