emulator: Android emulator version 30.3.5.0 (build_id 7033400) (CL:N/A) PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT

Viewed 1712

I am doing a react-native setup and getting this error.

C:\Users\Bilal Yaqoob>emulator -avd My_Phone
emulator: Android emulator version 30.3.5.0 (build_id 7033400) (CL:N/A)
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT

I also set the path in env variables below is the path I set

C:\Users\Bilal Yaqoob\AppData\Local\Android\Sdk\emulator
3 Answers

You have to use the right path that is C:\Users\Bilal Yaqoob\AppData\Local\Android\Sdk

I had a similar problem. My user path contains a non ASCII char. If the problem persists, try this:

Move .android and SDK folder and reset configs

  1. close all editors and all android related programs;

  2. check the location of the ".android" folder;

  3. create a new folder under a path which is highly compatible to faulty implementations (no-spaces, less 255 characters length, only ascii-characters [I put it in C:\Android and I moved also SDK folder into it.])

  4. move the .android-folder into the previously created folder;

  5. open the avd-subfolder of the .android-folder;

  6. open each ".ini"-file (each corresponding an emulator stored in a directory with the same name without the .ini-extension);

  7. replace the old path in the value of the path-property in each file by the new path of the .android-folder so that it points emulator-directory;

  8. open the windows environment variable settings dialog;

  9. add a new entry or edit the existing one for ANDROID_SDK_HOME (for me: C:\Android);

  10. set the value to the location of the folder which contains the .android-folder. (not the .android-folder itself [for me: C:\Android]);

  11. Move SDK content as specified here: How to move SDK file after android studio is installed

Confirm the solution is working in Visual Studio Code:

  1. start the editor;
  2. check if the emulators are listed in the device list (down-right blue button).

If you move folders like I did, you will have in windows environment variable I have:

  1. ANDROID_HOME = C:\Android\Sdk ;
  2. ANDROID_SDK_HOME = C:\Android ;
  3. ANDROID_SDK_ROOT = C:\Android\Sdk;

Solution inspired from some answers here: https://developercommunity.visualstudio.com/t/panic-cannot-find-avd-system-path-please-define-an/1005744

Maybe not, but I hope it can be useful anyway.

update your SDK tools - Android Emulator

Related