APK errors

INSTALL_FAILED_NO_MATCHING_ABIS

Error text

Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

Cause

The native libraries (.so) in the APK do not match the phone's processor architecture. For example only arm64 is present while the emulator is x86.

Step-by-step fix

  1. Learn the device ABI with adb shell getprop ro.product.cpu.abi.
  2. See which ABIs the APK contains with unzip -l app.apk | grep lib/.
  3. Add the needed architectures to abiFilters.
  4. For an emulator, choose an x86_64 or ARM system image.
  5. If a third-party library ships one ABI only, look for a newer one.

Example commands

adb shell getprop ro.product.cpu.abi
unzip -l app.apk | grep "lib/"
android { defaultConfig { ndk { abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86_64") } } }

How to prevent it

Keep arm64-v8a and armeabi-v7a in release and x86_64 for testing.

Author and license: Nibras Code