# INSTALL_FAILED_NO_MATCHING_ABIS：无法提取原生库

- **ID:** `android/install-apk-failed-incompatible`
- **领域:** android
- **类别:** install_error
- **错误码:** `INSTALL_FAILED_NO_MATCHING_ABIS`
- **验证级别:** ai_generated
- **修复率:** 88%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Android 5.0+ | active | — | — |
| AGP 7.0+ | active | — | — |
| Gradle 7.0+ | active | — | — |

## 解决方案

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
   ```

## 无效尝试

- **** — This prevents extraction but does not add missing ABIs; app still won't install if native libs are absent. (60% 失败率)
- **** — If the native libraries are not built for those ABIs, the APK will still lack them. (50% 失败率)
- **** — The issue is not build cache but missing native libraries for the target ABI. (80% 失败率)
