仿真器:错误:x86仿真当前需要硬件加速
本文翻译自:Emulator: ERROR: x86 emulation currently requires hardware acceleration
I tried to run my Hello World application in Android Studio. 我试图在Android Studio中运行我的Hello World应用程序。 I got the following error: 我收到以下错误:
Emulator: ERROR: x86 emulation currently requires hardware acceleration! 仿真器:错误:x86仿真当前需要硬件加速!
Please ensure Intel HAXM is properly installed and usable. 请确保正确安装了英特尔HAXM并可以使用它。
CPU acceleration status: HAX kernel module is not installed! CPU加速状态:未安装HAX内核模块!
Can you tell me what I can do with the error? 您能告诉我该怎么办吗?
#1楼
参考:https://stackoom.com/question/1YfEh/仿真器-错误-x-仿真当前需要硬件加速
#2楼
Install the Intel x86 Emulator Accelerator
using the Android SDK Manager 使用Android SDK Manager安装Intel x86 Emulator Accelerator
If you have Android Studio installed, you can start the SDK manager via Tools -> Android -> SDK Manager . 如果安装了Android Studio,则可以通过工具->安卓-> SDK管理器启动SDK管理器 。
The Android SDK Manager does not actually install HAXM , it just downloads it. Android SDK Manager 并未实际安装HAXM ,而只是下载了它。 In the top of the Android SDK manager window, you can find where the installer is located on your PC. 在Android SDK管理器窗口的顶部,您可以找到安装程序在PC上的位置。 Please open the subfolder extras\\intel\\Hardware_Accelerated_Execution_Manager
, and run the installer manually: intelhaxm-android.exe
. 请打开子文件夹extras\\intel\\Hardware_Accelerated_Execution_Manager
,然后手动运行安装程序: intelhaxm-android.exe
。
To use the intel HAXM, you need to have a CPU with virtualization support : 要使用英特尔HAXM,您需要具有支持虚拟化的CPU :
Before attempting to use this type of acceleration, you should first determine if your development system's CPU supports one of the following virtualization extensions technologies: 在尝试使用这种类型的加速之前,您应该首先确定开发系统的CPU是否支持以下虚拟化扩展技术之一:
- Intel Virtualization Technology (VT, VT-x, vmx) extensions 英特尔虚拟化技术(VT,VT-x,vmx)扩展
- AMD Virtualization (AMD-V, SVM) extensions (only supported for Linux) AMD虚拟化(AMD-V,SVM)扩展(仅Linux支持)
If your CPU does not have virtualization support, you could use an ARM emulator instead: 如果您的CPU不支持虚拟化,则可以改用ARM仿真器:
You can edit an existing, or add a new Virtual Device in the Android Virtual device Manager, and change CPU/ABI to ARM . 您可以在Android虚拟设备管理器中编辑现有虚拟设备或添加新的虚拟设备,然后将CPU / ABI更改为ARM 。 If that option is not available, you may need to change the target API of the Virtual Device, or download an ARM system image for the API version you want using the Android SDK manager. 如果该选项不可用,则可能需要更改虚拟设备的目标API,或使用Android SDK管理器下载所需API版本的ARM系统映像。
#3楼
Right click on your my computer icon and the CPU will be listed on the properties page. 右键单击我的计算机图标,CPU将在属性页上列出。 Or open device manager and look at the CPU. 或打开设备管理器并查看CPU。 It must be an Intel processor that supports VT and NX bit (XD) - you can check your CPU # at http://ark.intel.com 它必须是支持VT和NX位(XD)的Intel处理器-您可以在http://ark.intel.com上检查CPU#
Also make sure hyperV off bcdedit /set hypervisorlaunchtype off 还要确保关闭hyperV bcdedit / set hypervisorlaunchtype off
XD bit is on bcdedit /set nx AlwaysOn XD位在bcdedit / set nx AlwaysOn上
Use the installer from https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager 使用https://software.intel.com/zh-cn/android/articles/intel-hardware-accelerated-execution-manager中的安装程序
If you're using Avast, disable "Enable hardware-assisted virtualization" under: Settings > Troubleshooting. 如果使用的是Avast,请在“设置”>“故障排除”下禁用“启用硬件辅助虚拟化”。 Restart the PC and try to run the HAXM installation again 重新启动PC,然后尝试再次运行HAXM安装
#4楼
As per this response , the complete steps are: 根据此响应 ,完整的步骤是:
1) Open SDK Manager (In Android Studio, go to Tools > Android > SDK Manager) and Download Intel x86 Emulator Accelerator (HAXM installer) if you haven't. 1)打开SDK Manager(在Android Studio中,转到“工具”>“ Android”>“ SDK Manager”),如果没有,请下载Intel x86 Emulator Accelerator(HAXM安装程序)。
2) Now go to your SDK directory C:\\users\\%USERNAME%\\AppData\\Local\\Android\\sdk\\extras\\intel\\Hardware_Accelerated_Execution_Manager\\
and run the file named intelhaxm-android.exe
. 2)现在转到您的SDK目录C:\\users\\%USERNAME%\\AppData\\Local\\Android\\sdk\\extras\\intel\\Hardware_Accelerated_Execution_Manager\\
并运行名为intelhaxm-android.exe
的文件。
In case you get an error like "Intel virtualization technology (vt,vt-x) is not enabled". 如果出现类似“未启用英特尔虚拟化技术(vt,vt-x)”的错误。 Go to your BIOS settings and enable Hardware Virtualization. 转到BIOS设置并启用“硬件虚拟化”。
3) Restart Android Studio and then try to start the AVD again. 3)重新启动Android Studio,然后尝试再次启动AVD。
It might take a minute or 2 to show the emulator window. 显示仿真器窗口可能需要一两分钟。
#5楼
This steps worked on Mint 17.2 Rafaela: 这些步骤适用于Mint 17.2 Rafaela:
- Open a terminal and input this:
sudo apt-get install qemu-kvm
打开一个终端并输入以下内容:sudo apt-get install qemu-kvm
- Restart your pc and enable virtualization technology on your BIOS setup 重新启动电脑并在BIOS设置中启用虚拟化技术
- In terminal again, insert this:
sudo kvm-ok
在终端中再次插入:sudo kvm-ok
#6楼
I wasted too much time on this, I find that the AVAST is the issue!!!
我在此上浪费了太多时间, I find that the AVAST is the issue!!!
If you have AVAST installed in you system, you have to: 如果您的系统中安装了AVAST,则必须:
Go to
settings
tab -->troubleshooting
, then you should UNCHECK the "enable hardware-assisted virtualization
" 转到“settings
选项卡->“troubleshooting
,然后应取消选中“enable hardware-assisted virtualization
”
Restart your PC, the install the intelhaxm-android.exe if it is not installed. 重新启动PC,如果未安装intelhaxm-android.exe,请安装它。 You can find it: 您可以找到它:
C:\\Users\\{YOURUSERNAME}\\AppData\\Local\\Android\\sdk\\extras\\intel\\Hardware_Accelerated_Execution_Manager