Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator - error while loading state for instance 0x0 of device 'goldfish_pipe'

I updated some android studio components 2 days ago and everything messed up. Now I cant use android emulator since it exits immediately the moment it gets lunched.

I already tried the following:

  1. Delete all my virtual devices and created new ones - didn't work.
  2. Wipe Emulator data - didn't work.
  3. Tried to lunch emulator manually in AVD - didn't work
  4. Launch emulator with the option Cold boot now. - Emulator displayed this message Cold boot: requested by the user and exit.
  5. Uninstall Android Studio and deleted whole SDK folder and downloaded everything new - didn't work may be bacause the problem is within latest release.
  6. Tried to downgrade Emulator manually! I asked it here - I downloaded the previous release and deleted everything in sdk\emulator and put files there, Deleted all virtual devices and create new ones. Pressed run. this message pops up when emulator start Cold boot different AVD Configuration and then it exits again. This is may be I didn't downgrade all emulator related tools, I don't know how!. And sometimes different message pops up saying Resetting for cold boot: emulation engine failed and exits.

None of these worked and I am out of ideas.

Here are logs get printed before emulator flash disappearance.

16:00 Emulator: C:\Users\Nux\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'

16:00 Emulator: deleteSnapshot: for default_boot

16:00 Emulator: qemu: unsupported keyboard cmd=0x84

16:00 Emulator: Process finished with exit code 0

Screenshot of emulator before disappearance enter image description here

SDK Tools screenshot enter image description here

Edit Several issues have been submitted already:

  1. https://issuetracker.google.com/issues/132481542
  2. https://issuetracker.google.com/issues/132834989
  3. https://issuetracker.google.com/issues/131854864
like image 275
Nux Avatar asked May 07 '19 13:05

Nux


2 Answers

This issue has been fixed in HAXM 7.4.1, So just make sure you are using latest HAXM. Check latest version here

Old Answer

Temporary solution to this problem is to decrease number of cpu.ncore from 4 to either 1 or 2. Go to avd and find your virtual device and inside edit config.ini then change ncore=4 to ncore=2

Path to config.ini for my virtual device is C:\Users\Nux\.android\avd\Pixel_2_API_28.avd\config.ini

You can also go to this path from AVD manager. Click drop down of device of your choice and click show on disk

It worked for me. source https://issuetracker.google.com/issues/132481542

Caution: Emulator may be slow. Hope this problem is fixed in next update.

like image 82
Nux Avatar answered Nov 06 '22 12:11

Nux


I'm getting the same thing, but I'm unable to consistently produce the error.

When I get the error I perform the following steps:

  1. Close the emulator if it somehow opened with that error message (that's happened to me)

  2. Open AVD

  3. Wipe the drive

  4. Start the emulator from AVD

  5. Once the emulator is up, I hit run and select the running emulator.

THIS is not a fix for whatever the hell is going on with our 'goldfish_pipe', but it is something that I've been able to do to work around it. It's the equivalent of - spinning 3 times, gargling water and saying a prayer backwards. >.<

That being the case, I'm following this thread for any solutions. If I discover anything new I'll post it, but if anyone can reproduce this error please let me know how.

like image 3
Justin Schwimmer Avatar answered Nov 06 '22 12:11

Justin Schwimmer