我尝试在Android Studio中运行我的Hello World应用程序。我得到了以下错误:

模拟器:ERROR: x86仿真目前需要硬件 加速度! 请确保Intel HAXM已正确安装并可用。 CPU加速状态:HAX内核模块未安装!

你能告诉我如何处理这个错误吗?


当前回答

在Mac上,Android SDK安装在:/Users/username/Library/Android/ SDK /,因此,你需要运行脚本sudo,如下所示:

sudo sh /Users/username/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh

如果一切顺利,脚本将输出消息:“通过静默安装!”

然后,重新启动Android Studio并使用所需的AVD运行应用程序。

其他回答

对我来说,以下的解决方案是有效的:

1]进入BIOS设置并启用虚拟化。

Right click on your my computer icon and the CPU will be listed on the properties page. Or open device manager and look at the CPU. It must be an Intel processor that supports VT and NX bit (XD) - you can check your CPU # at http://ark.intel.com Also make sure hyperV off bcdedit /set hypervisorlaunchtype off XD bit is on bcdedit /set nx AlwaysOn Use the installer from https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager If you're using Avast, disable "Enable hardware-assisted virtualization" under: Settings > Troubleshooting. Restart the PC and try to run the HAXM installation again

我遇到了同样的问题,但在我的BIOS上关闭Hyper-V并启用VT-x后,我仍然无法安装intelhaxm-android.exe程序。

为了解决我的问题,我不得不关闭Windows防御程序内存完整性

检查这里的步骤-> https://github.com/intel/haxm/issues/105

根据这个回复,完整的步骤是:

1)打开SDK管理器(在Android Studio中,进入Tools > Android > SDK管理器),如果没有下载英特尔x86模拟器加速器(HAXM安装程序)。

2)现在进入你的SDK目录C:\users\%USERNAME%\AppData\Local\Android\ SDK \extras\intel\Hardware_Accelerated_Execution_Manager\并运行名为intelhaxm-android.exe的文件。

如果你得到一个错误,如“英特尔虚拟化技术(vt,vt-x)未启用”。进入BIOS设置,启用“硬件虚拟化”。

3)重新启动Android Studio,然后尝试再次启动AVD。

显示模拟器窗口可能需要一到两分钟。

如果您使用的是AMD CPU,现在正式支持AMD虚拟化(如Ryzen CPU)。确保在BIOS中开启了虚拟化。

在“打开或关闭Windows功能”(你可以通过Windows搜索找到它)中,你需要启用它

Windows 10上的Windows Hypervisor平台17134.1(1803)2018年4月更新或更新(通常在文章中没有提到) hyper - v

重启并启动模拟器(x86版本)后,它应该开始启动,不会出现上述错误。