flutter - appbundle 颤振应用程序的 64 位显示停止器错误
问题描述
我正在尝试将我们的颤振应用程序发布到谷歌游戏商店,我得到了似乎是一个显示停止错误的东西......
错误
此版本不符合 Google Play 64 位要求
以下 APK 或 App Bundle 可用于 64 位设备,但它们只有 32 位本机代码: 3.
在您的应用程序中包含 64 位和 32 位本机代码。使用 Android App Bundle 发布格式自动确保每个设备架构只接收它需要的本机代码。这样可以避免增加应用程序的整体大小。 学到更多
有谁知道如何解决这一问题?当我用谷歌搜索这个错误时,我什么也没看到。我们只是想在那里进行封闭式 Alpha 测试。
解决方案
我终于可以通过将它添加到 build.gradle 来解决这个问题
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
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
}
}
}
推荐阅读
- django - 无法访问 django API
- ansible - Ansible 复制模块。“找不到来源”
- regex - Powershell替换文本文件中的整行
- reactjs - 如何在反应组件中集成链接?
- sql - 如何将 nvarchar(255) 转换为 YYYY-MM-DD 格式?
- swift - 闭包错误:闭包 #1 中的闭包 #1 中的闭包
- reactjs - reactjs中如何根据特定路由更改标题样式?
- excel - 将PPT幻灯片导出为JPG
- python - 如何选择窗口客户区的特定部分以显示在 Python/PyQt5/PySide2/Tkinter 任务栏中的窗口缩略图中?
- javascript - 如何访问本地存储中对象数组中的值?