Complete Guide to Resolving INSTALL_FAILED_NO_MATCHING_ABIS Error in Android Applications

Nov 21, 2025 · Programming · 40 views · 7.8

Keywords: Android Development | ABI Compatibility | Native Libraries | Gradle Configuration | INSTALL_FAILED_NO_MATCHING_ABIS

Abstract: This article provides an in-depth analysis of the common INSTALL_FAILED_NO_MATCHING_ABIS error in Android development, typically caused by native library ABI mismatches. It details the solution of configuring splits block in Gradle to generate multi-architecture APKs, complete with code examples and configuration explanations. The content explores the root causes of the error, ABI compatibility principles, and alternative solutions such as using specific ABI emulators. Covering the complete workflow from problem diagnosis to practical fixes, it helps developers thoroughly resolve such native library compatibility issues.

Problem Background and Error Analysis

During Android application development, developers frequently encounter installation errors such as INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113. This error code indicates that the system cannot find native library files matching the device's processor architecture when attempting to extract them from the application.

From a technical perspective, the core issue lies in ABI (Application Binary Interface) mismatch problems. Android devices use different processor architectures such as ARM, x86, MIPS, etc., and each architecture requires specifically compiled native libraries. When an application contains native libraries incompatible with the target device's processor architecture, the system cannot properly load these library files, resulting in installation failure.

Solution: Gradle Configuration for Multi-Architecture Support

The most effective solution is to configure ABI split options in the project's build.gradle file. By adding splits configuration within the android block, you can instruct the build system to generate separate APK files for different processor architectures.

Here is the complete configuration example:

android {
    // Other configuration items...
    
    splits {
        abi {
            enable true
            reset()
            include 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'arm64-v8a'
            universalApk true
        }
    }
}

Let's analyze each part of this configuration in detail:

The enable true directive activates the ABI split functionality, allowing the build system to generate separate APKs for different architectures. This setting is the core of the solution, ensuring that the build process considers multiple processor architectures.

The reset() method clears any default ABI configurations, providing a clean starting point. This is particularly important when dealing with complex project dependencies, as it prevents unexpected configuration conflicts.

The include statement specifies the list of processor architectures to support. This list covers all major architectures in the current Android ecosystem:

The universalApk true option instructs the build system to create a universal APK containing all architectures in addition to architecture-specific APKs. This universal APK has a larger size but can run on devices of any architecture, providing convenience for testing and distribution.

Implementation Principles and Technical Details

When ABI splitting is configured, the Gradle build system performs the following operations: First, it scans all native library files (.so files) in the project, identifying the architecture types they support. Then, for each architecture specified in the include list, the build system creates an APK file containing only the native libraries for that architecture.

During the installation process, the Android package manager checks the device's processor architecture and selects the matching APK for installation. If no matching architecture is found, it throws the INSTALL_FAILED_NO_MATCHING_ABIS error. By providing APKs for multiple architectures, we ensure that regardless of what architecture the user's device uses, a suitable installation package can be found.

It's worth noting that in modern Android development practices, Google Play supports uploading APK bundles (.aab files) containing multiple architectures, and the store automatically distributes the appropriate architecture version for each user device. However, for direct APK installation or using other distribution channels, the multi-APK solution remains necessary.

Alternative Solutions and Best Practices

In addition to the Gradle configuration solution, developers can consider other resolution methods. For example, during development and testing phases, you can create emulators with specific architectures. If the application is primarily tested for x86 architecture, you can configure the emulator to use the x86_64 system image, thus avoiding architecture mismatch issues.

However, this emulator solution is only suitable for development and testing environments and is not practical for production application distribution. The real solution should be to ensure the application supports all processor architectures that target users might use.

In actual development, the following best practices are recommended:

  1. Plan the native library architecture support strategy early in the project
  2. Regularly test the application's operation on devices with different architectures
  3. Use CI/CD pipelines to automatically build and test multi-architecture versions
  4. Monitor the architecture distribution of user devices to optimize support strategies

Compatibility Considerations and Future Outlook

As the Android ecosystem evolves, the support situation for processor architectures continues to change. In recent years, ARM architecture has dominated mobile devices, while x86 architecture is primarily used in emulators and a few tablet devices. MIPS architecture has gradually exited the mainstream market.

Developers should optimize architecture support strategies based on the device distribution of their target user base. For applications targeting global markets, supporting all major architectures is recommended; for applications targeting specific regions or device types, the support list can be streamlined according to actual circumstances.

Looking forward, as 64-bit devices become more prevalent and new processor architectures emerge, ABI compatibility management will become increasingly important. Google already requires new applications to support 64-bit architecture, further highlighting the importance of properly handling native library compatibility.

Through the Gradle configuration solution introduced in this article, developers can systematically resolve the INSTALL_FAILED_NO_MATCHING_ABIS error, ensuring that applications can be successfully installed and run on various Android devices. This solution not only addresses immediate problems but also provides a solid foundation for long-term application compatibility.

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.