Solution:
Identify ANDROID_SDK_ROOT as environment variable where your SDK is located, default path would be "C:\Program Files (x86)\Android\android-sdk" and restart computer to take effect.
Open Android Studio and under the Tools
you will trace the AVD manager
. Click on it and make sure you have a valid virtual device with the SDK downloaded (click "download" in the Actions column in case shown).
Then, Go to Control Panel>>System and Security>>System>>Advance system settings>>Environment Variables then place variable value of ANDROID_HOME set it like this "C:\Users\username\AppData\Local\Android\sdk" set username as your pc name, then restart your android studio. afterwards you can make your AVD again than the error will fix than it will begin the virtual device.
For those who are using a Mac:
I had the same problem and the problem was, I made an emulator with API Level 29 however removed that SDK and installed 28 instead. The emulator that was not able to be launched anymore.
Hence inspect the AVD Manager in case your emulator truly can be launched.
Ensure that you have an Android Virtual Device chosen to output the app to. In the picture I set on this post you can see I have chosen the Android Virtual Device "Nexus 5" as the output device. Follwing this removed the error for me.
Attempt to use the argument: -sysdir <Your_SDK_DIR>
and then check whether the error message shown.
Check out these clip you will trace out the cause:
// Sanity checks.
if (avdName) {
if (!isCpuArchSupportedByRanchu(avdArch)) {
APANIC("CPU Architecture '%s' is not supported by the QEMU2 emulator, (the classic engine is deprecated!)",
avdArch);
}
std::string systemPath = getAvdSystemPath(avdName, sysDir);
if (systemPath.empty()) {
const char* env = getenv("ANDROID_SDK_ROOT");
if (!env || !env[0]) {
APANIC("Cannot find AVD system path. Please define "
"ANDROID_SDK_ROOT\n");
} else {
APANIC("Broken AVD system path. Check your ANDROID_SDK_ROOT "
"value [%s]!\n",
env);
}
}
}
Find the ANDROID_HOME path values from environment variable. In my case it is like C:\Users\RuwanPr\AppData\Local\Android\Sdk.
If this value not found please add ANDROID_HOME value as your sdk path.
(To go to environment variable right click on my computer -> Properties -> Advance System Settings -> Environment Variable )
Then open cmd on windows and go to sdk folder and then go to tools folder
Type emulator -list-avds in comd. It will shows avd name list.
Then type emulator -avd avd-name.
Ex - think avd-name shows as J2_Api_22
emulator -avd J2_Api_22