Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Emulator gives error: Cold Boot: Snapshot doesn't exist

I am having issues with Android Emulator since 7-8 days. At first it was not runing at all now reinstalling the emulator solved that issue but giving birth to new one.

Whenever I run the emulator it takes alot of time, almost 5-6 minutes and then shows an error: Cold Boot: Snapshot doesn't exist

After restarting several times now emulator runs but still shows the error in the beginning.

like image 784
Robert Williams Avatar asked Mar 14 '18 04:03

Robert Williams


People also ask

What is cold boot in Android emulator?

The first time you start an Android Virtual Device (AVD) with the Android Emulator, it must perform a cold boot (just like powering on a device), but subsequent starts are fast and the system is restored to the state at which you closed the emulator last (similar to waking a device).

How do I fix Android Emulator not working?

If the Android Emulator does not start properly, this problem is often caused by problems with HAXM. HAXM issues are often the result of conflicts with other virtualization technologies, incorrect settings, or an out-of-date HAXM driver. Try reinstalling the HAXM driver, using the steps detailed in Installing HAXM.


2 Answers

I too faced this issue for a while and recently resolved it. Through reading other SO posts it definitely seems to be related to the snapshot that the Emulator is trying to boot from - as eluded to by @Raimo's answer. Although I don't fully understand the cause for why this is happening (it happened to all of the AVDs I had saved) I've resolved it by configuring my AVD to perform a "cold boot" instead of a "quick boot" whenever I launch it. This solves the "Snapshot doesn't exist" message & the emulator boots as expected, allowing you to run and test your application.

Steps to fix the issue:

  1. Open the Android Virtual Device Manager (Tools -> AVD Manager)
  2. Select the Virtual Device you'd like to use & click "Edit this AVD" (the Pencil icon)
  3. The "Virtual Device Configuration" window should now be open. Click the "Show Advanced Settings" button at the bottom of the window and scroll to the "Emulated Performance" section
  4. You'll see an option called "Boot option" which is typically set to "Quick Boot" by default - switch this to "Cold boot" and click "Finish".

Start the Virtual Device now (close it if you previously had it running whilst making these changes so that they take effect). The "Snapshot doesn't exist" message won't appear and your emulator will start as expected.

The only downside to this option is that the state of the device when you last used it won't be stored i.e. your apps you previously had open.

like image 104
Scott Barbour Avatar answered Sep 30 '22 20:09

Scott Barbour


Quick Boot is not reliable when software rendering is enabled. If Quick Boot does not work, click Edit this AVD from the AVD Manager and change Graphics from either Automatic or Software to Hardware.

Source: https://developer.android.com/studio/run/emulator.html#quickboot-troubleshooting

like image 28
Raimo Avatar answered Sep 30 '22 19:09

Raimo