I have Windows 11 on my system.
The system specifiction:
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
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....\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: WHPX: Failed to setup partition, hr=c0350005
C:\Users....\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: failed to initialize WHPX: Invalid argument
Anyone got suggestions, how to resolve this issue.
As stated by Георги Ангелов:
The latest version of Android Emulator - 31.1.2 is fixing the issue. Update through SDK Manager. Released 11/11/2021.
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/emulator-linux_x64-7869535.zip
macosx: https://dl.google.com/android/repository/emulator-darwin_x64-7869535.zip
WHPX as of now is not working with Windows 11, I will update this answer when it gets fixed.
To disable Hyper-V you must follow these steps:
Turn Windows features on or off
.Hyper-V
and Windows Hypervisor platform
(it may be required to uncheck Windows Sandbox
).Android Emulator Hypervisor Driver for AMD Processors (installer)
.cd C:\Users\User\AppData\Local\Android\Sdk\emulator\
with your user..\emulator.exe -avd Pixel_4a_API_30 -accel off
with your AVD device name.