android - Android 无法将应用程序添加到谷歌商店 APK 或 App Bundle 可用于 64 位设备,但它们只有 32 位本机代码
问题描述
当我尝试将应用程序放入谷歌商店时,我看到了这个:
此版本不符合 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
}
}
}
但我无法在谷歌商店添加 apk
编辑
编辑
[![在此处输入图像描述][3]][3]
编辑 [![在此处输入图像描述][4]][4]
解决方案
支持 64 位架构的所有内容都在这里
https://inneka.com/programming/android/how-to-include-so-library-in-android-studio-2/
检查您的项目结构并包含如下库..
project/
├──libs/
| └── *.jar <-- if your library has jar files, they go here
├──src/
└── main/
├── AndroidManifest.xml
├── java/
└── jniLibs/
├── arm64-v8a/ <-- ARM 64bit
│ └── yourlib.so
├── armeabi-v7a/ <-- ARM 32bit
│ └── yourlib.so
└── x86/ <-- Intel 32bit
└── yourlib.so
推荐阅读
- batch-file - 将 cmd 变量分配给 for do 循环的输出
- ruby-on-rails - Rails 5:将 time_ago_in_words 从控制器传递到视图时出错
- html - 如何在图像类的css中设置宽度和高度
- ios - Swift - 在 Xcode 中内联显示断言失败,如 XCTest 失败?
- android - Firebase 查询 limitToLast 无法按预期工作
- php - 如何在购物车中显示店铺名称?
- python - 将熊猫数据框列拆分为几列的最有效方法
- python - KeyError:在 Repl.it 上安装 pyautogui 时出现“显示”
- c# - 识别用于密码验证的单词变体
- python - 数据框 fit_transform 抛出错误,看似不正确的错误