'The selected AVD is currently running in the Emulator

I keep seeing the error message below in andriod studio. I am aware there are already posts that deal with this error. They specify that I go to the location C:\Users\XXXX.android\avd\ and delete the folder Pixel_API_25.avd and Pixel_API_25.ini. However I cannot delete these files as it says they are currently in use. I can't see where though?

The selected AVD is currently running in the Emulator. Please exit the emulator instance and try deleting again.


Solution 1:[1]

AVD Pixel_3a_API_29 is already running. If that is not the case, delete the files at

  • In my case
  • Go to C:\Users\xxxxx(system name)\.android\avd\Pixel_3a_API_29(emulator name folder)
  • Delete folder hardware-qemu.ini.lock
  • Go to Android Studio -> AVD Manager -> Relaunch emulator

Solution 2:[2]

For Windows

  • Go to FileManager.
  • Go to C://Users/nameOfYourSystem/.android/.avd
  • delete corresponding (selected AVD) configuration setting file.
  • Go to Android Studio -> AVD Manager. Your AVD should not listed here

For MacOS

  • Open YOUR_USERNAME/.android/avd
  • Delete the corresponding configuration setting file.

Solution 3:[3]

Same as @Kalai answer for MacOS

  • In your terminal: open YOUR_USERNAME/.android/avd
  • Delete corresponding configuration setting File.

Solution 4:[4]

On Windows you can stop the AVD by ending the "qemu-system-x86_64.exe" process in the task-manager. After that you should be able to delete the files.

Solution 5:[5]

For Linux:

  • Go to: YOUR_USERNAME/.android/avd/NAME_OF_EMULATED_DEVICE (to show .hidefiles just press CTRL+H)
  • Delete all files with .lock extension
  • Relaunch emulator in Android Studio

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vaibhav gupta
Solution 2 Thibault Walterspieler
Solution 3 Matt Walterspieler
Solution 4 qwertz
Solution 5 ifrit