ABS
ABS

Reputation: 1121

Error installing build on emulator

I am using android studio and I created an emulator(Nexus 5x). When I try to install the apk from android studio, it gives me following error

The currently selected variant "aosp-debug" uses split APKs, but none of the 1 split apks are compatible with the current device with density "400" and ABIs "x86".

Error while Installing APK

After following THIS LINK, I saw that I have correct build variant set and I am still facing this problem.

Upvotes: 2

Views: 2854

Answers (1)

ABS
ABS

Reputation: 1121

I was able to find the answer here: APK SPLIT

All you need to do is to generate an x86 build. You can make this happen by following code:

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

To use emulator run command: gradlew -Px86 assemble. This will create 2 artifacts, one for armeabi-v7a and one for x86. You can use x86 for emulator. Android studio is smart enough to choose the correct one.

Upvotes: 4

Related Questions