Hello and welcome to the 3rd installment of the infamous Android Emulator on Windows saga. Despite the combined 3 trillion dollar market cap of Microsoft and Google, this remains to be a problem harder than going to the moon.
Below is the somewhat comprehensive list for Windows (so far as of circa 11/2022)
First make sure you have the latest version of Windows. As of writing, this is Windows 11 22H2 with all updates installed. If you have an older version of Windows, you'll have to try each one of the below, with possibly different combinations. Otherwise follow from the top until your issue is solved. It is ordered from the easiest/most likely culprit on a decent Windows machine, to the most unlikely cause.
Note that if you're doing below on a corporate machine, some of the below actions may be blocked by your admin, and/or flag your machine as suspicious activity as some actions intentionally turns off some security features. Depending on your situation, you may want to give a heads-up to your IT/security team.
If your Windows device has Bitlocker enabled on your boot drive contact your IT admin first. Messing with virtualization and boot configuration may trigger bitlocker prompts upon reboot. If you're working from home,this may mean taking your laptop to the office to get it unlocked by IT, as Windows may refuse to boot without unlocking BitLocker.
To find what is blocking the emulator launch, the surefire way is to open a terminal (cmd or powershell) and launch to from there as below.
First kill any existing emulator.exe instances, adb.exe instances, java.exe instances, qemu instances, android studio instances. Check in task manager to be sure.
The adb relaunches itself so its ok be running. But make sure android studio is not running. It seems to lock files/cache and not flush emulator configs, that may crash the emulator at launch, without any useful logs.
in a terminal
cd your_sdk_location\emulator
emulator.exe -list-avds
- this will list what AVDs you have. Find the one you want
emulator.exe -avd your_avd_name -verbose
This will have a long log, and will have some information on what the failure is. If you see a VM heap size being outside of limits, it may say that it it automatically set to lowest or highest value. This is a lie. Open emulator settings and set it to within the limits manually, usually 550MB works. Launch android studio and edit the emulator instance to be within this limit, then close android studio, then wait about 30 seconds before attempting to launch the emulator. For all attempts of launching the emulator below, do not rely on android studio, launch from command line instead.
Note that the emulator editor UI in android studio can corrupt the config at times. If this happens, I don't know where this is stored, so you may have to delete and re-create the AVD. If this doesn't work, do not change and configs during AVD creation, then launch it from command line.
If the emulator doesn't launch, no useful failure logs, yet the emulator.exe exits after a few minutes, you may have android studio running. Exit/Kill Android studio, wait a minute or so and try again. If still fails, reboot.
Have an Antivirus (other than Microsoft Defender)?
- Disable it
- Reboot and try to launch the emulator
Disable Hypervisor Boot
- open an admin terminal (cmd or powershell)
- run
bcdedit /set hypervisorlaunchtype off
- try to launch the emulator. If still broken, try rebooting.
If your failure is due to install of HAXM/AMD hypervisor driver failing
- run
systeminfo
in a terminal
- at the end under
Hyper-V Requirements:
if it says A hypervisor has been detected
this means emulator cannot launch virtualization.
- Open Start > Windows Security > Device Security > Core isolation
- turn off Core Isolation (previously known as Memory Integrity/Isolated User Mode)
- Open
Turn Windows features on or off
and disable
- Hyper-V Platform
- Hyper-V Management Tools
- Windows Hypervisor Platform
- You can enable them after HAXM/AMD Driver install
- on an admin prompt run
bcdedit /set hypervisorlaunchtype off
- reboot
- try to launch the emulator
Check BIOS
- go into BIOS/UEFI setup and look for settings like
- VT-x
- VT-d
- Virtualization Technology
- Hardware Virtualization
- Make sure these settings are enabled
- try to launch the emulator
Uninstall Docker Desktop
- Some users have reported that uninstalling Docker Desktop fixed their issue.
- It is unclear as to why docker desktop interferes with haxm installation. The reason is probably that it supports running docker images via a Hyper-V backend, and disabling this feature does not remove the hypervisor completely.
- Go to Settings -> Add or remove programs, and uninstall docker desktop
- reboot
- try to launch the emulator
Nothing works
- You shouldn't get here, since Android emulator can now run alongside with Hyper-V if you have 'Windows Hypervisor Platform' enabled.
- If nothing above works, as a last resort you can try running Android in a Hyper-V VM and get ADB to connect to it. (Not a solution, but a workaround)
- You can also run android using a third-party emulator like Genimotion.
¯\(ツ)/¯