Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

When I try to install the android application on API 26. I am getting this error.

First I have tried with build tool version - 25.3.1 encounter same issue as shown in the below image.

enter image description here

and then I have updated build tools version to 26.0.1 and support library version to 26.0.0.

with recent Google Play Service Version - 11.0.4.

I have checked whether android libraries which I am using have native code i.e., C++ code but every library library I used is written in Java expect one library with bits of PHP,Python and Ruby.

I am Using

  1. Google Maps
  2. Google Location
  3. Google GCM.

I have tried including ABI Splits in my Gradle file as mentioned here

splits {
    abi {
        enable true
        reset()
        include 'x86', 'armeabi-v7a'
        universalApk true
    }
}

But encountered same error everytime.

Emulator Device Details :

enter image description here

like image 834
Nagarjuna Yelisetty Avatar asked Jul 31 '17 14:07

Nagarjuna Yelisetty


2 Answers

Based from this thread, this problem occurs when your app uses ARM architecture and the device or emulator that you are trying to install the app support otherwise such as x86. Try installing it on ARM emulator. Also, if your app is built with the ARMv7 architecture in mind, be sure to only use system images with ABI: armeabi-v7a.

Additional references:

  • http://discuss.cocos2d-x.org/t/how-to-compile-for-x86-64-or-x86-in-android-studio/36755
  • https://www.underwise.com/questions/233541/android-emulator-install-failed-no-matching-abis-failed-to-extract-native-lib

Hope this helps!

like image 134
abielita Avatar answered Oct 07 '22 05:10

abielita


This problem occurs when ADB can not install the proper APK according to the phone or emulator you are using. ABI split can resolve this easily.

splits {
abi {
    enable true
    reset()
    include 'x86', 'x86_64', 'armeabi-v7a'
    universalApk true
    }
}

But if it can not (this seems as your case too), then it looks like some of the libraries you are using does not support the API level of the phone or emulator. To ensure this is the case, try installing your app on different API level emulators or phone and you will notice that it runs on few and doesn't support few others. There might be some native libraries that isn't compatible with all Android versions.

In my case I was successful in running the app on phones with android other than android Oreo and Pie. Reason was my gradle had this below implementation that did not support mentioned API levels (28 and above).

implementation 'org.apache.directory.studio:org.apache.commons.io:2.4'

If you have any such library that might not support all versions then try changing it's version to newer ones or just remove it if you can achieve your functionality without it. In my case I was lucky enough that I did not needed it at all and removing it resolved the issue.

like image 43
Rathore Avatar answered Oct 07 '22 03:10

Rathore