While launching AVD in emulator showing this "Unable to locate adb"

Lalit picture Lalit · Jun 4, 2020 · Viewed 14.3k times · Source

error

It was working before but after 4.0 update it's not working.

Errors are

08:55 AM Emulator: C:\Users\Asus\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: error while loading state for instance 0x0 of device 'goldfish_pipe' 08:55 AM Emulator: deleteSnapshot: for default_boot

and yes I don't have antivirus.

Answer

asaio picture asaio · Jan 25, 2021

Reinstalling Android SDK after deleting the platform-tools dir doesn't work for everyone follow these steps, they may help you:

  1. In Android Studio go to File>Project Structure (Ctrl + Alt + Shift + S in windows);

  2. The Project Settings>Project>Project SDK must have a valid Android SDK selected;

  3. Start the adb-server daemon with adb.exe start-server (this is to avoid the: adb wasn't listening on port XXXX error message);

  4. Emulate a new device (if you've added %ANDROID_HOME%\emulator to your path run emulator.exe -list-avds select one of the virtual devices from the list and run emulator.exe -avd , if not find out your Android SDK path and change the previous commands accordingly);

  5. check if the adb daemon is running and recognizes the emulated device: open cmd prompt, run %ANDROID_HOME%\platform-tools\adb.exe devices and it should list the device you have on at the moment.