【问题标题】:android studio avd manager invalid option -- '-enable-whpx'android studio avd manager 无效选项——'-enable-whpx'
【发布时间】:2019-01-24 18:33:05
【问题描述】:

我在使用 android studio avd manager 运行任何模拟器时遇到错误:

...AppData\Local\Android\Sdk\emulator/emulator-x86.exe: invalid option -- '-enable-whpx' 
  • android studio 版本为 3.1.3
  • android模拟器版本为27.3.9
  • Hyper-V 和 Windows Hypervisor Platform 在我的 Windows 10 上处于活动状态
  • 并且 WindowsHypervisorPlatform = on 标志设置为 ...sdk\emulator\lib/advancedFeatures.ini

这是详细模式的一部分:

emulator: Checking whether Windows Hypervisor Platform (WHPX) is available.
emulator: Could not load library WinHvPlatform.dll
emulator: WHPX is either not available or not installed.
emulator: CPU Acceleration: working
emulator: CPU Acceleration status: HAXM version 7.2.0 (4) is installed and usable.

在 windows 功能中检查了 Windows Hypervisor Platform,WinHvPlatform.dll 出现在 C:\Windows\System32

如何启用或安装 WHPX?

【问题讨论】:

  • 您找到解决此问题的方法了吗?如果是这样,请发布答案。谢谢。
  • @Maarten 查看我的答案

标签: android android-studio android-emulator android-sdk-tools avd-manager


【解决方案1】:

我的问题通过简单地改变模拟器引擎解决了。

根据documentation,您可以使用-engine 标志指定模拟器引擎。使用classic 引擎会发生上述错误。当我将引擎更改为autoqemu2 时,模拟器启动时没有出现错误。要更改引擎,请使用命令行转到.../sdk/emulator 目录并运行:

emulator.exe -list-avds

这将输出你的虚拟设备名称

然后运行:

emulator.exe -avd YOUR_DEVICE_NAME -engine qemu2

emulator.exe -avd YOUR_DEVICE_NAME -engine auto

希望对你有帮助。

【讨论】:

  • 我试过 emulator.exe -avd YOUR_DEVICE_NAME -engine qemu2 或 emulator.exe -avd YOUR_DEVICE_NAME -engine auto 不工作
  • @Dmarp 您是否将 YOUR_DEVICE_NAME 替换为您的设备名称?
猜你喜欢
  • 1970-01-01
  • 2018-04-20
  • 1970-01-01
  • 1970-01-01
  • 2016-06-25
  • 2017-05-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多