Android Studio Emulator 无法在使用 WHPX 的 Windows 11 上运行 [英] Android Studio Emulator is not working on Windows 11 using WHPX
问题描述
我的系统上有 Windows 11.
系统规格:
I have Windows 11 on my system.
The system specifiction:
- 版本:Windows 11 Home Single Language
- 更新:21H2
- 安装日期: 06- 07- 2021
- 操作系统版本:22000.65
- 体验:Windows 功能体验包 421.17400.45.3
我全新安装了 Android Studio.现在我想在没有英特尔 HAXM 的情况下运行模拟器,因为我想在 wsl2 旁边运行它.
I have fresh installed Android Studio. Now I want to run the emulator without Intel HAXM as I want to run it alongside wsl2.
所以在我的可选功能中,这两个功能是启用的
So in my optional feature, these two features are enabled
- Windows HyperVisor 平台
- 虚拟机平台
但在运行模拟器时出现此错误:
But while running the emulator I'm getting this error:
❯ .emulator.exe -avd Pixel_3a_API_30
emulator: Android emulator version 30.7.5.0 (build_id 7491168) (CL:N/A)
handleCpuAcceleration: feature check for hvf
added library vulkan-1.dll
C:Users....AppDataLocalAndroidSdkemulatorqemuwindows-x86_64qemu-system-x86_64.exe: WHPX: Failed to setup partition, hr=c0350005
C:Users....AppDataLocalAndroidSdkemulatorqemuwindows-x86_64qemu-system-x86_64.exe: failed to initialize WHPX: Invalid argument
任何人都得到了建议,如何解决这个问题.
Anyone got suggestions, how to resolve this issue.
推荐答案
最终更新:
如 Георги Ангелов 所述:
最新版本的 Android Emulator - 31.1.2 正在解决此问题.通过 SDK 管理器进行更新.2021 年 11 月 11 日发布.
The latest version of Android Emulator - 31.1.2 is fixing the issue. Update through SDK Manager. Released 11/11/2021.
如 Mark Wood-Patrick 回答中所述,模拟器尚未更新,但您可以下载新的带有修复程序的模拟器二进制文件!
As stated in Mark Wood-Patrick answer, the emulator hasn't been updated yet but you can download the new emulator binaries with the fix!
windows:https://dl.google.com/android/repository/emulator-windows_x64-7869535.zip
linux:https://dl.google.com/android/repository/模拟器-linux_x64-7869535.zip
macOS:https://dl.google.com/android/repository/模拟器-darwin_x64-7869535.zip
WHPX 目前无法与 Windows 11 一起使用,我会在修复后更新此答案.
WHPX as of now is not working with Windows 11, I will update this answer when it gets fixed.
要禁用 Hyper-V,您必须按照以下步骤操作:
To disable Hyper-V you must follow these steps:
- 打开
开启或关闭Windows功能
. - 取消选中
Hyper-V
和Windows Hypervisor平台
(可能需要取消选中Windows Sandbox
). - 打开 Android Studio 和 SDK 管理器.
- 在 SDK 工具中,安装
Android Emulator Hypervisor Driver for AMD Processors(安装程序)
.
- Open
Turn Windows features on or off
. - Uncheck
Hyper-V
andWindows Hypervisor platform
(it may be required to uncheckWindows Sandbox
). - Open Android Studio and SDK Manager.
- In SDK tools, install
Android Emulator Hypervisor Driver for AMD Processors (installer)
.
不加速打开模拟器
- 打开一个终端.
- 与您的用户一起输入
cd C:UsersUserAppDataLocalAndroidSdkemulator
. - 使用您的 AVD 设备名称输入
.emulator.exe -avd Pixel_4a_API_30 -accel off
.
这篇关于Android Studio Emulator 无法在使用 WHPX 的 Windows 11 上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!