今天,我所有的 Android模拟器(在Win10 / IntelliJ IDEA上), 开始抱怨缺少图书馆。
当我启动任何模拟器时,在加载过程中,我会在控制台日志上阅读:
仿真器:无法加载库'WinHvPlatform.dll'
然后,模拟器启动,并且似乎运行正常。
但是...有人知道这可能是什么原因吗? 那是什么图书馆?
答案 0 :(得分:1)
应为Android模拟器禁用Hyper-V,而应使用Intel HAXM(如果您的处理器支持)。另外,请确保您使用的是更新的Android SDK 27工具和仿真器,它们可以更新as explained in this article。
答案 1 :(得分:1)
这是因为Microsoft已与Google合作,允许使用Hyper-V代替Intel HAXM作为虚拟机管理程序。请参阅这些文章:
Windows Hypervisor平台于4月10日在Windows中引入 2018更新并允许第三方虚拟化堆栈使用 Windows Hypervisor进行硬件加速。如果您正在使用 Hyper-V,此堆栈取代了Intel HAXM作为Windows的虚拟机管理程序 Android模拟器。
如果运行ANDROID_SDK\emulator\emulator.exe -avd YOURAVD -verbose
,则可能会得到以下输出:
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: DISABLED
emulator: CPU Acceleration status: HAXM is not installed on this machine
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
您可以按照上述文章中的说明通过以下操作在%USERPROFILE%\.android\advancedFeatures.ini
中为Google的Android模拟器关闭Windows Hypervisor:
WindowsHypervisorPlatform=off