Android Studio 模拟器错误(需要 Intel HAXM/未安装模拟器)

Android Studio Emulator Error (Intel HAXM is Required / No Emulator Installed)

我刚刚将 Android API 更新为 25,我的模拟器已停止工作。当我尝试 运行 我的模拟器时,它给我一个错误 "Intel HAXM is required to run this AVD. No emulator installed. Please Download the emulator" 作为弹出窗口(如下所示)并且 Event Log 打印出 "Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Run (or updating either the IDE or the Gradle plugin to the latest version)"。

令我困惑的是,我通过设置关闭了 Instant 运行,并且在 SDK Tools 中下载了 Intel x86 Emulator。

错误:

SDK 管理员:

即时运行:

安装它并再次尝试 运行。

SDK 管理器只下载英特尔 HAXM 安装程序,但在很多情况下并不进行实际的应用程序安装。

从那里转到 {SDK location}/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/ 和 运行 MSI 安装程序。

此外,您必须在计算机的 BIOS 中启用 VTX 扩展。

唯一对我有用的解决方案是...

  1. 转到您的 SDK 文件夹位置并删除 "emulator" 和 "system-images" 文件夹。
  2. 打开 android studio -> 工具 -> Android -> SDK 管理器
  3. 切换到 SDK Tools 选项卡检查 Intel x86 Emulator Accelerator(HAXM 安装程序)单击 OK
  4. 成功安装 HAXM 后转到 Android Studio -> Tools -> Android -> AVD Manager 删除所有以前的模拟器并创建新的 AVD。

对我来说,问题是即使我从安装的 windows 组件中删除 Hyper-V 也没有卸载它。我从: https://github.com/intel/haxm/blob/master/docs/manual-windows.md

Certain advanced Windows 10 features, such as Device Guard (in particular, Hypervisor-protected code integrity or HVCI) and Credential Guard, can prevent Hyper-V from being completely disabled. In other words, when any of these features are enabled, so is Hyper-V, even though Windows may report otherwise.

很有帮助,它说了如何解决它,经过两天的挫折,它对我有用:

The Device Guard and Credential Guard hardware readiness tool released by Microsoft can disable the said Windows 10 features along with Hyper-V:

  1. 从这里下载最新版本的工具。以下步骤假定版本为 3.6.
  2. 解压缩。
  3. 打开提升的(即 运行 管理员)命令提示符。
  4. @powershell -ExecutionPolicy RemoteSigned -Command "X:\path\to\dgreadiness_v3.6\DG_Readiness_Tool_v3.6.ps1 -Disable"
  5. 重启。

这会禁用 Device Guard 和 Credential Guard,并允许 HAXM 控制虚拟化。重启后,HAXM 应该可以毫无问题地从 Android SDK 管理器安装。祝你好运。