21

I am trying to run an emulator over Android Studio, but it's not starting.

I have Android studio (version 23 marshmallow), configured with

minSdkVersion 21
targetSdkVersion 23

When I run my app in emulation (nexus 5x api 23 android 6.0), I get the following error:

Error while waiting for device: The emulator process for AVD Nexus_5X_API_23 was killed.

Can anybody help me on this, please?

Prune
  • 76,765
  • 14
  • 60
  • 81
Amit
  • 211
  • 1
  • 2
  • 4
  • I can give a suggestion... Have you tried using the Genymotion emulators? I find the Android emulator to be a huge memory and energy (my Macbook Pro laptop can't hold a full charge while the Android emulator is running and I have the laptop plugged in) resource hog. – Jason Grife May 17 '16 at 16:25
  • Have you tried running your app on a real device and confirmed it worked? Have you tried running other emulators on your computer in the past? – buczek May 17 '16 at 16:26
  • You should _really_ accept an answer, wha you are doing it's a really bad practice. – Henrique de Sousa Jul 25 '16 at 00:16

5 Answers5

39

If you take a look at the 4: Run log, it says:

emulator: ERROR: Unfortunately, there's an incompatibility between HAXM hypervisor and VirtualBox 4.3.30+ which doesn't allow multiple hypervisors to co-exist. It is being actively worked on; you can find out more about the issue at http://b.android.com/197915 (Android) and https://www.virtualbox.org/ticket/14294 (VirtualBox)

In my case, there was a VirtualBox docker instance running and once I stopped it, the emulator started to work.

Henrique de Sousa
  • 5,727
  • 49
  • 55
  • I think only the person who asked the question can accept the answer or I would. – mvndaai May 25 '16 at 16:17
  • 2
    This seems to be a problem with _any_ other hypervisor, not just VirtualBox. The new Docker beta uses xhyve and I still get an error about VirtualBox incompatibility if `docker` is running, even though VirtualBox isn't installed. – bonh Jun 06 '16 at 16:46
  • 1
    Cheers, this worked for me, I had to stop virtual box instances and make sure virtual box was closed as well – Peter Fox Jun 29 '16 at 08:21
  • I would've never guessed Docker was causing this issue. Closed it and worked! Thanks! – Danish Khan Jul 27 '16 at 01:45
  • Is that log something different from the window that pops up when you click the `4: Run` button at the bottom? The only info I'm getting in that window is: `09/27 10:21:51: Launching app Error while waiting for device: The emulator process for AVD Nexus_6_API_24 was killed.` – Ben Sutton Sep 27 '16 at 16:33
5

In my case docker / dlite was running and once I stopped them, the emulator started to work.

docker stop $(docker ps -a -q)    
dlite stop

Or quit docker for mac via the top right menu bar item.

Note that you might need to restart Android Studio.

Wojtek Dmyszewicz
  • 4,188
  • 5
  • 30
  • 42
1

Installing Microsoft Visual C++ 2015-2019, did the trick for me... was missing a dll file for some reason.

Debugging

  • Android Studio just said emulator crashed.
  • Run the emulator.exe in cmd really helps in windows.
  • $HOME/tools is where you find emulator.exe
  • emulator.exe @name_of_avd or just do emulator.exe -list-avds

All the best

Abhinava B N
  • 165
  • 1
  • 12
0

If your running Windows OS, then check whether the graphics driver is installed and is working fine. As the emulator needs good and/or proper graphics configuration. Try installing the graphics driver if not installed and running the emulator again.

Hope this works!, this worked for me.

0

My problem was with Nexus 6 23 and resolved it doing the following:

  • cd $HOME/Android/Sdk/emulator/lib64/libstdc++
  • Rename the file libstdc++.so.6 (Ubuntu): mv libstdc++.so.6 libstdc++.so.6.bak
  • Ready, it worked for me!

I hope it can help you!

rmarquez
  • 1
  • 1