Troubleshooting an Android Studio Emulator Startup Failure

When I tried to open an Android Virtual Device (AVD), Android Studio suddenly displayed: Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT.

Most of the solutions I found recommended creating an ANDROID_SDK_ROOT environment variable, but that made no difference in my case.

What worked was creating an ANDROID_SDK_HOME environment variable and setting its value to the directory where I wanted the virtual machine installed:

image-20200716214244002

image-20200716214300771

After setting the variable, restart Android Studio and reopen AVD Manager. The existing images no longer appeared for me; after downloading and installing one again, the emulator worked.