Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android app-universal.apk fails to install on Emulator

My app uses the Zoom SDK. I was having trouble installing it on the Android emulator with an x86 system image (specifically, 23, 24, 25 on several devices), getting the error:

INSTALL_FAILED_NO_MATCHING_ABIS

I was able to solve this problem using a suggestion from another StackOverflow post, by putting the following in my build.gradle.

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

However, now in my app/builds/outputs/apk folder, there are multiple apk's being generated, namely:

app-arm64-v8a-debug.apk
app-armeabi-debug.apk
app-armeabi-v7a-debug.apk
app-mips-debug.apk
app-mips64-debug.apk
app-universal-debug.apk
app-x86-debug.apk
app-x86_64-debug.apk

Edit: Creating a release build also creates these same versions, minus the 'debug' name, using 'release' instead. According to the documentation,

A universal APK contains code and resources for all ABIs in a single APK.

However, when I try to install the app-universal.apk, I fail with the same ABIS error as before. I also tried to generate the release build, which failed with the same error.

Installing the app-x86-debug.apk on the emulator works just fine, however. So, it seems to me like the documentation on the universal apk does not seem to match the actual behavior.

Can someone explain to me how I can generate an apk that will run on both android devices and the emulator? If not, why am I not getting the expected behavior form app-universal.apk ?

like image 967
epnought Avatar asked Nov 08 '22 21:11

epnought


1 Answers

You should add libraries in respective folders. There should be three or two folders under your libs based on how many you want to add.

arm64-v8a
armeabi-v7a
x86

If you do not have x86 and build the universal app, it will not install since this lib will be missing in the final package.

The app-x86-debug.apk will install since it will not have any native library version. But after installing app-x86-debug.apk your app will crash on emulator.

like image 57
Showdawn Avatar answered Nov 15 '22 13:11

Showdawn