简体   繁体   English

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

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

I just updated my Android API to 25, and my emulators have since stopped working.我刚刚将我的 Android API 更新为 25,我的模拟器从此停止工作。 When I try to run my emulator, it gives me the error "Intel HAXM is required to run this AVD. No emulator installed. Please Download the emulator" as a popup (shown below) and the Event Log prints out "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)".当我尝试运行我的模拟器时,它给我错误“运行此 AVD 需要英特尔 HAXM。未安装模拟器。请下载模拟器”作为弹出窗口(如下所示),并且Event Log打印出“运行应用程序时出错:此版本的 Android Studio 与所使用的 Gradle 插件不兼容。尝试禁用 Instant Run(或将 IDE 或 Gradle 插件更新到最新版本)”。

What I am confused about is that I have turned off Instant Run via settings and I have downloaded the Intel x86 Emulator in SDK Tools.我感到困惑的是,我已经通过设置关闭了 Instant Run,并且我已经在 SDK Tools 中下载了 Intel x86 Emulator。

Error:错误: 在此处输入图片说明

SDK Manager: SDK经理: 在此处输入图片说明

Instant Run:即时运行: 在此处输入图片说明

The SDK manager only downloads the Intel HAXM installer, but does not do the actual application installation in many cases. SDK 管理器仅下载英特尔 HAXM 安装程序,但在许多情况下不进行实际应用程序安装。

Go to {SDK location}/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/ and run the MSI installer from there.转到{SDK location}/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/并从那里运行 MSI 安装程序。

Additionally you have to enable VTX extensions in your BIOS on the computer.此外,您必须在计算机的 BIOS 中启用 VTX 扩展。

The only solution works for me is...唯一对我有用的解决方案是......

  1. Goto your SDK folder location and delete "emulator" and "system-images" folder.转到您的 SDK 文件夹位置并删除“emulator”和“system-images”文件夹。
  2. Open android studio -> Tools -> Android -> SDK Manager打开android studio -> Tools -> Android -> SDK Manager
  3. Switch to SDK Tools tab check Intel x86 Emulator Accelerator (HAXM installer) click OK切换到 SDK Tools 选项卡检查 Intel x86 Emulator Accelerator (HAXM installer) 单击 OK
  4. After successfully installing HAXM goto Android Studio -> Tools -> Android -> AVD Manager Delete all previous emulators and create new AVD.成功安装 HAXM 后,转到 Android Studio -> Tools -> Android -> AVD Manager 删除所有以前的模拟器并创建新的 AVD。

Install this and try to run again.安装它并尝试再次运行。

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

For me, the problem was that Hyper-V was not uninstalled even when I removed it from installed windows components.对我来说,问题是即使我从已安装的 Windows 组件中删除了 Hyper-V,也没有卸载它。 I got this from: https://github.com/intel/haxm/blob/master/docs/manual-windows.md我从: 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.某些高级 Windows 10 功能,例如 Device Guard(特别是受管理程序保护的代码完整性或 HVCI)和 Credential Guard,可以防止 Hyper-V 被完全禁用。 In other words, when any of these features are enabled, so is Hyper-V, even though Windows may report otherwise.换句话说,当启用这些功能中的任何一个时,Hyper-V 也会启用,即使 Windows 可能会报告其他情况。

Helpfully, it says how to solve it, and it worked for me after two days of frustration:有用的是,它说明了如何解决它,经过两天的挫折后,它对我有用:

The Device Guard and Credential Guard hardware readiness tool released by Microsoft can disable the said Windows 10 features along with Hyper-V: Microsoft 发布的 Device Guard 和 Credential Guard 硬件准备工具可以禁用上述 Windows 10 功能以及 Hyper-V:

  1. Download the latest version of the tool from here.从这里下载该工具的最新版本。 The following steps assume version 3.6.以下步骤假定版本为 3.6。
  2. Unzip.解压。
  3. Open an elevated (ie Run as administrator) Command Prompt.打开提升的(即以管理员身份运行)命令提示符。
  4. @powershell -ExecutionPolicy RemoteSigned -Command "X:\\path\\to\\dgreadiness_v3.6\\DG_Readiness_Tool_v3.6.ps1 -Disable" @powershell -ExecutionPolicy RemoteSigned -Command "X:\\path\\to\\dgreadiness_v3.6\\DG_Readiness_Tool_v3.6.ps1 -Disable"
  5. Reboot.重启。

This disables Device Guard and Credential Guard and allows HAXM to get control of virtualization.这会禁用 Device Guard 和 Credential Guard,并允许 HAXM 控制虚拟化。 After the reboot, HAXM should install from the Android SDK manager without issue.重启后,HAXM 应该从 Android SDK 管理器安装,没有问题。 Good luck.祝你好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM