Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/223.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安装内置仿真器时出错_Android_Android Emulator_Android Studio 2.0 - Fatal编程技术网

Android 安装内置仿真器时出错

Android 安装内置仿真器时出错,android,android-emulator,android-studio-2.0,Android,Android Emulator,Android Studio 2.0,我使用的是android studio,我创建了一个模拟器(Nexus 5x)。当我试图从AndroidStudio安装apk时,它给出了以下错误 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". 安装APK时出错 在完

我使用的是android studio,我创建了一个模拟器(Nexus 5x)。当我试图从AndroidStudio安装apk时,它给出了以下错误

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".
安装APK时出错


在完成以下操作后,我发现我拥有正确的构建变量集,我仍然面临这个问题。

我在这里找到了答案:

您所需要做的就是生成一个x86版本。您可以通过以下代码实现这一点:

splits {
    abi {
        enable true
        reset()
        include 'x86', 'armeabi-v7a'
        universalApk false
    }
}
要使用emulator运行命令:gradlew-Px86 assemble。
这将创建两个工件,一个用于armeabi-v7a,另一个用于x86。您可以将x86用于emulator。Android studio足够聪明,可以在build.gradle Android{}块中选择正确的。有关详细信息,请使用此链接: