INSTALL_FAILED_NO_MATCHING_ABIS android install_error ai_generated true

INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries

ID: android/install-apk-failed-incompatible

Also available as: JSON · Markdown · 中文
88%Fix Rate
85%Confidence
1Evidence
2024-01-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
Android 5.0+ active
AGP 7.0+ active
Gradle 7.0+ active

Root Cause

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

generic

中文

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

Official Documentation

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

Workarounds

  1. 90% success Add splits block to build.gradle to generate APKs per ABI: splits { abi { enable true reset() include 'arm64-v8a', 'armeabi-v7a', 'x86_64' universalApk false } }
    Add splits block to build.gradle to generate APKs per ABI: splits { abi { enable true reset() include 'arm64-v8a', 'armeabi-v7a', 'x86_64' universalApk false } }
  2. 85% success Ensure NDK is installed and native libraries are built for all target ABIs via CMake or ndk-build
    Ensure NDK is installed and native libraries are built for all target ABIs via CMake or ndk-build
  3. 80% success Use a universal APK (no ABI split) by removing abiFilters and setting universalApk true
    Use a universal APK (no ABI split) by removing abiFilters and setting universalApk true

中文步骤

  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

Dead Ends

Common approaches that don't work:

  1. 60% fail

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

  2. 50% fail

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

  3. 80% fail

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