Error installing build on emulator

时间:2016-04-04 18:54:08

标签: android android-emulator android-studio-2.0

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.

1 个答案:

答案 0 :(得分:4)

我能在这里找到答案:APK SPLIT

您需要做的就是生成x86版本。您可以通过以下代码实现此目的:

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

使用模拟器运行命令:gradlew -Px86汇编。 这将创建2个工件,一个用于armeabi-v7a,另一个用于x86。您可以使用x86进行模拟器。 Android studio足够聪明,可以选择正确的。