INSTALL_FAILED_NO_MATCHING_ABIS android install_error ai_generated true

INSTALL_FAILED_NO_MATCHING_ABIS:无法提取原生库

INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries

ID: android/install-apk-failed-incompatible

其他格式: JSON · Markdown 中文 · English
88%修复率
85%置信度
1证据数
2024-01-10首次发现

版本兼容性

版本状态引入弃用备注
Android 5.0+ active
AGP 7.0+ active
Gradle 7.0+ active

根因分析

APK 不包含设备 CPU 架构所需的本机库(例如,设备为 64 位时缺少 arm64-v8a)。

English

The APK does not contain native libraries for the device's CPU architecture (e.g., missing arm64-v8a when device is 64-bit).

generic

官方文档

https://developer.android.com/ndk/guides/abis

解决方案

  1. 在 build.gradle 中添加 splits 块以按 ABI 生成 APK:splits { abi { enable true reset() include 'arm64-v8a', 'armeabi-v7a', 'x86_64' universalApk false } }
  2. 确保安装了 NDK 并通过 CMake 或 ndk-build 为所有目标 ABI 构建原生库
  3. 使用通用 APK(无 ABI 拆分),移除 abiFilters 并设置 universalApk true

无效尝试

常见但无效的做法:

  1. 60% 失败

    This prevents extraction but does not add missing ABIs; app still won't install if native libs are absent.

  2. 50% 失败

    If the native libraries are not built for those ABIs, the APK will still lack them.

  3. 80% 失败

    The issue is not build cache but missing native libraries for the target ABI.