[INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
Asked Answered
R

14

84

I have an issue with third party libraries that are imported to my project.

I read quite a lot of articles about that but do not get any information how properly handle it.

I put my classes .so to the folder.

enter image description here

Problem is that the i try to run the app i receive

[INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
Recombination answered 4/4, 2016 at 22:45 Comment(2)
try this link : for android 3.0.1: https://mcmap.net/q/74397/-install_failed_no_matching_abis-failed-to-extract-native-libraries-res-113Jahncke
I faced the same issue when tried to install release apk on emulator. In my case what worked for me is installing the release apk on real device :) Hope it helps somebody else tooTrodden
J
123

July 25, 2019 :

I was facing this issue in Android Studio 3.0.1 :

After checking lots of posts, here is Fix which works:

Go to module build.gradle and within Android block add this script:

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

Simple Solution. Feel free to comment. Thanks.

Jahncke answered 25/3, 2018 at 7:42 Comment(17)
it will create apk that are intended for each type (release.apk, armeabi-v7a-release.apk, universal-release.apk, x86-release.apk) check if you use the jniLibs folder, usually that's what generates the problemHyperesthesia
You can add in include also ,'x86_64'Dizen
Have the same error. But also in Gradle add this ( splits{... ) nothing change!Ivan
This did not work for me, using Samsung Galaxy. Prior to Android 8.0, this worked very well.Broncho
@MGDeveloper did u try other values in it like mips64, it may workJahncke
@ShobhakarTiwari So it turns out that one of the two of changes we made to the app were bad. One change had errors in our app activity xml which caused "Aapt2Exception: AAPT2 error" and the other change included a dependency jar which had previous version jar packaged inside the jar file itself. After deleting those changes, the app is now installed. I also realized my error was producible on any device that has Android 8.0, real or emulator. Hence I am not sure if I needed this splits configuration, and if this answer is actually a fix or work around. I can create a new answer if needed.Broncho
I'm facing this when running my project into emulator x86. And this solutions works seamlesslySecondary
universalApk was the key for me after updating to latest gradle [React Native]Regal
ndk - abiFilters conflicts with splits - abi one and doesn't throw except if splits - abi - universalApk is set to false ! In any case, do not use both option types at the same time !Dagan
this didn't fix the issueAceto
The actual fix was to remove: implementation 'org.apache.directory.studio:org.apache.commons.io:2.4'Aceto
build.gradle is an existing file when working with Android Studio project, but it is not available on Xamarin Android project, anyone know here to add that info on a Xamarin Android project?Inequity
So why did you never have to do this for Ant? Not a fan of Gradle..Trunkfish
not working at all with android studio arctic fox 2020.3.1 | patch 3Copyholder
not working - AS ChipmunkTabina
Not working - Android Studio Bumblebee 2021.1.1 Patch 3Unseemly
Working with the update to the latest version of the gradle. Thanks for the suggestionBatch
C
27

I faced same problem in emulator, but I solved it like this:

Create new emulator with x86_64 system image(ABI)

select device

select x86_64

That's it.

This error indicates the system(Device) not capable for run the application.

I hope this is helpful to someone.

Cellar answered 13/6, 2017 at 9:0 Comment(1)
Thanks! This was what made me realize I was trying to run a x86_64 apk on an x86 image.Calcaneus
N
15

13 September 2018 It worked for me when add more types and set universalApk with false to reduce apk size

splits {
    abi {
        enable true
        reset()
        include 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'arm64-v8a'
        universalApk false
    }
}
Nonunion answered 13/9, 2018 at 15:19 Comment(2)
@IgorGanapolsky to reduce time of generate apks and i don't need universalApkNonunion
ndk - abiFilters conflicts with splits - abi one and doesn't throw except if splits - abi - universalApk is set to false ! In any case, do not use both option types at the same time !Dagan
P
13

If you got this error when working with your flutter project, you can add the following code in the module build.gradle and within Android block and then in the defaultConfig block. This error happened when I was trying to make a flutter apk build.

android{
    ...
    defaultConfig{
        ...
        //Add this ndk block of code to your build.gradle
        ndk {
            abiFilters 'armeabi-v7a', 'x86', 'armeabi'
        }
    }
}
Prosenchyma answered 9/9, 2019 at 6:20 Comment(3)
@warning - ndk - abiFilters conflicts with splits - abi one and doesn't throw except if splits - abi - universalApk is set to false ! Do not use both at the same time !Dagan
ndk { abiFilters "armeabi", "x86", "armeabi-v7a","x86_64", "mips", "mips64", "arm64-v8a" } worked for mePrepotency
I saw this error trying to install an apk from the game library LibGDX. It uses NDK resources. These three lines were the fix, thanks !!Jeuz
R
11

Doing flutter clean actually worked for me

Rectrix answered 10/5, 2020 at 17:19 Comment(2)
I though that I need to do some complicated things to solve the problem but it worked for me, too.Pleuron
same here, I didn't have to add to the build.gradle, in the end, flutter clean + flutter run (or install)Use
T
6

Android 9 and Android 11 emulators have support for arm binaries.

https://developer.android.com/studio/releases/emulator#support_for_arm_binaries_on_android_9_and_11_system_images

I had the same issue while using x86 emulator with API level 29, trying to install an apk targeting arm ABI.

I tried x86 emulator with API level 30 and it worked fine.

Tutelage answered 11/9, 2020 at 10:37 Comment(1)
Thanks. It worked and I blogged it here: swtestacademy.com/how-to-run-arm-apk-on-x86-systemsThorium
A
4

This is caused by a gradle dependency on some out-of-date thing which causes the error. Remove gradle dependencies until the error stops appearing. For me, it was:

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

This line needed to be updated to a newer version such as:

api group: 'commons-io', name: 'commons-io', version: '2.6'
Aceto answered 3/8, 2020 at 1:14 Comment(1)
this was exactly my case thank you for saving the dayEucken
D
3

My app was running on Nexus 5X API 26 x86 (virtual device on emulator) without any errors and then I included a third party AAR. Then it keeps giving this error. I cleaned, rebuilt, checked/unchecked instant run option, wiped the data in AVD, performed cold boot but problem insists. Then I tried the solution found here. he/she says that add splits & abi blocks for 'x86', 'armeabi-v7a' in to module build.gradle file and hallelujah it is clean and fresh again :)

Edit: On this post Driss Bounouar's solution seems to be same. But my emulator was x86 before adding the new AAR and HAXM emulator was already working.

Discrown answered 21/2, 2018 at 12:37 Comment(0)
P
2

As of 21st October 2021, i fixed this by adding these lines to the app level build.gradle

defaultConfig {
   ndk {
         abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'arm64-v8a'
        }
}
Parenthesis answered 21/10, 2021 at 7:57 Comment(0)
C
1

Anyone facing this while using cmake build, the solution is to make sure you have included the four supported platforms in your app module's android{} block:

 externalNativeBuild {
            cmake {
                cppFlags "-std=c++14"
                abiFilters "arm64-v8a", "x86", "armeabi-v7a", "x86_64"
            }
        }
Cabbage answered 27/6, 2019 at 4:35 Comment(0)
G
1

The solution that worked for me (Nov 2021) was adding an exclusion to the packagingOptions within the build.gradle file.

android {
    packagingOptions {
        exclude("lib/**")
    }
}

Specifically the exclude() part must be standalone and in the function even though it may show as deprecated (with a line through it in IntelliJ). That will resolve the issue.

Gallardo answered 24/11, 2021 at 16:41 Comment(0)
R
0

After some time i investigate and understand that path were located my libs is right. I just need to add folders for different architectures:

  • ARM EABI v7a System Image

  • Intel x86 Atom System Image

  • MIPS System Image

  • Google APIs

Recombination answered 15/4, 2016 at 10:2 Comment(1)
Add folders, where?Curtal
C
0

Make the splits depend on the same list of abis as the external build. Single source of truth.

android {
// ...
defaultConfig {
// ...
    externalNativeBuild {
        cmake {
            cppFlags "-std=c++17"
            abiFilters 'x86', 'armeabi-v7a', 'x86_64'
        }
    }
} //defaultConfig

splits {
    abi {
        enable true
        reset()
        include defaultConfig.externalNativeBuild.getCmake().getAbiFilters().toListString()
        universalApk true
    }
}
} //android
Concinnity answered 14/11, 2019 at 13:57 Comment(1)
tried but still getting the error message failed to install parse error string messagePerpendicular
I
0

In my case, I faced the same issue in the Flutter project and I solved this issue by running the below commands:

flutter clean
flutter run
Inaugurate answered 2/10, 2023 at 11:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.