18

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
Community
  • 1
  • 1
Nux
  • 5,890
  • 13
  • 48
  • 74

9 Answers9

20

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.

Nux
  • 5,890
  • 13
  • 48
  • 74
  • I experienced this now. I tried some of the suggestions in this and other answers, like decreasing the ncore value from 4 to 2, decreasing memory to 512Mb, but neither worked. Installing the latest version of HAXM fixed the problem. – TMan Oct 20 '20 at 12:52
3

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.

Justin Schwimmer
  • 185
  • 1
  • 12
  • @Beyhan have you find any solution? I have been stuck for days now! – Nux May 13 '19 at 20:56
  • @Nux What steps are you taking to create the error? Also, did you get the latest updates: Android Emulator rev. 29.0.9 & Android SDK Platform-Tools rev. 28.0.3? – Justin Schwimmer May 13 '19 at 22:20
  • @JustinSchwimmer yes. I am using latest components. I have added screenshot of SDK tools, please have a look at it! – Nux May 14 '19 at 09:27
  • @JustinSchwimmer What steps are you taking to create the error?, I don't know If I have understood this question correctly! But all I could get were the logs I have provided above and it seems I am not the only one who is facing this issue. Before updating android studio to latest release(3.4) all things were fine. – Nux May 14 '19 at 09:34
  • @Nux What I meant was, what actions do you take before seeing this error? For instance, do you just start android studio, hit "run", load your emulator (not through AVD) and this error appears; or if you use AVD first to load your emulator? Perhaps re-installing Anroid Emulator under SDK tools would help? I randomly stopped getting this error and I didn't do anything... so I want to recreate the error on my end following the steps you take prior to seeing this error. – Justin Schwimmer May 15 '19 at 04:45
  • @JustinSchwimmer it happens when I hit run or debug or when I lunch emulator through AVD Manager. So anything that will make emulator start/lunch it will disappear immediately. – Nux May 15 '19 at 07:14
  • @Beyhan check for answer – Nux May 23 '19 at 14:48
2

Andorid 10 resolve by:

reinstall HAXM

Ado
  • 411
  • 4
  • 9
2

The answer for me was to enable WHPX. Turn it on in "Turn windows features on and off". See more here: https://developer.android.com/studio/run/emulator-acceleration

user37309
  • 597
  • 5
  • 14
1

Try below steps

  1. Disable any anti-virus software you are using.
  2. Restart Android studio
  3. Create a new virtual device or Wipe data if you have an existing one
  4. Start virtual device with "Cold Boot Now"

If the above steps work then add below exceptions to your anti virus software

  • C:\Users\YOUR_USERNAME\AppData\Local\Android\*
  • C:\Program Files\Android\*

UPDATE!!: It seems the windows update is the culprit. The only solution I found is to signUp for windows insider and get the latest release under "fast" option in windows 10. I am running build 18941.rs_prerelease.190713-1700 and the emulator is working now. Hope this helps until this version of windows goes to production.

Hitesh Bisht
  • 486
  • 1
  • 6
  • 11
  • I am using Avast, I tried your solution but It doesn't work. Whenever I start with cold boot the emulator pops this message "Cold boot: requested by the user" and disappear. I dont think antivirus is the culprit here because I have try to disable it several times. – Nux May 15 '19 at 07:26
  • After recent update in avast .It detected adb.exe as virus. After I did above steps it fixed for me. – Hitesh Bisht May 16 '19 at 05:34
  • 1
    @Nux Please check the updated answer. Hope it helps. Thanks – Hitesh Bisht Jul 20 '19 at 06:35
  • This was HAXM issue it is already fixed in latest release, But thanks for response. – Nux Jul 20 '19 at 17:35
1

i just lowered the RAM to < 768MB, worked for me

1

I have the same problem with Pixel 3 emulator device. Changing API levels (28, 29) doesn't help. Hard delete and recreate doesn't help.

Then I change to Pixel XL API 29 emulator device and quick boot works again.

Xuan
  • 578
  • 6
  • 14
0

Issue solved. I have reinstalled Win10 Home Edition and all other software including Android Studio and Emulators. @Nux, I hope that helps.

Beyhan
  • 99
  • 1
  • 1
0

I recently got this exact same issue and tried all the possible solution, i had a minor windows update that was paused since 7 days back, and what i did was to simply install it and the emulator started to work again.

Fluzzy
  • 81
  • 2
  • 8