'emulator: ERROR: A snapshot operation for 'Nexus_4_API_27' is pending and timeout has expired. Exiting

emulator: ERROR: A snapshot operation for 'Nexus_4_API_27' is pending and timeout has expired. Exiting...

I am getting this error when I am trying to open emulator from command-line with this bellow command.

anjan@anjan-HP-Laptop-15-bs0xx:~/Android/Sdk/emulator$ ./emulator -avd Nexus_4_API_27

How to solve this problem?



Solution 1:[1]

It is caused be the lock file generated by the boot which reside in the folder = .android/avd/{yourDeviceName}.

we can delete by using sudo rm snapshot.lock.lock command.

enter image description here

Then cold booting the device again ,solves the issue.

Solution 2:[2]

If you have android studio installed (Obviously) just open the AVD Manager, select the device and choose 'Stop' by using the right click. Then the device will be released.

Solution 3:[3]

I had this error in ubuntu and the fix was to change the owner of my $HOME/.android folder into my current user. ie.

sudo chown -R [username] $HOME/.android

Solution 4:[4]

sudo chown -R $(whoami) $HOME/.android

then

./emulator -avd Pixel_2_API_28

above command will do the trick!

If it get below error!

emulator: ERROR: x86 emulation currently requires hardware acceleration!
CPU acceleration status: This user doesn't have permissions to use KVM (/dev/kvm)
More info on configuring VM acceleration on Linux:
https://developer.android.com/studio/run/emulator-acceleration#vm-linux
General information on acceleration: https://developer.android.com/studio/run/emulator-acceleration.

try with

sudo ./emulator -avd Pixel_2_API_28

It worked for me!

Solution 5:[5]

  • Click on the 'down arrow' for the selected device from the device manager

  • Show on desk

  • hardware-qemu.ini.lock

  • multiinstance.lock

  • snapshot.lock.lock

  • Delete this three files

Enjoy!! It works with macOS don't know about windows

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 Mukundhan
Solution 2 Pedro
Solution 3 fire in the hole
Solution 4 Rajath
Solution 5 raavan199