我有一个 NDK 项目,我正在构建 armeabi-v7a、arm64-v8a 和 x86 的版本。在手机上运行代码很好,但尝试在 x86 模拟器上运行时,虽然可以成功构建,但会报以下错误:
当前选择的变体“debug”使用分离 APK,但没有一个分离的 apk 与具有密度“560”和 ABI “x86”的当前设备兼容。
最初,我尝试避免使用分离的 APK,通过在 build.gradle 中执行以下操作:
但是重新阅读错误提示后,它说没有任何1个分割APK。只有一个不兼容的生成的APK文件,所以我猜测可能是生成了错误的APK文件?那么我应该使用哪些工具来深入挖掘呢?
当前选择的变体“debug”使用分离 APK,但没有一个分离的 apk 与具有密度“560”和 ABI “x86”的当前设备兼容。
最初,我尝试避免使用分离的 APK,通过在 build.gradle 中执行以下操作:
splits {
// Configures multiple APKs based on screen density.
density {
// Configures multiple APKs based on screen density.
enable false
}
// Configures multiple APKs based on ABI
abi {
// Enables building multiple APKs per ABI.
enable true
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for armeabi-v7a, arm64-v8a, and x86
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include 'armeabi-v7a', 'arm64-v8a', 'x86'
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk true
}
}
但是重新阅读错误提示后,它说没有任何1个分割APK。只有一个不兼容的生成的APK文件,所以我猜测可能是生成了错误的APK文件?那么我应该使用哪些工具来深入挖掘呢?