Android emulator not starting at all

androidandroid-emulator

Today I tried to launch my Android app from within eclipse but nothing happened. Everything worked fine yesterday. I tried a few things like adb kill-server, adb-start-server. At some point I got the "user data image is used by another emulator" error, so I went about deleting the .lock folders in the avd image but to no avail.

I created a new avd and the emulator doesnt even start with this image. I tried to start it with

emulator -avd avdname

->nothing. No error. emulator.exe is running in Taskmanager.

Windows 7
Android SDK Tools, revision 7

Update: Now I know when I get the error

emulator: ERROR: the user data image is used by another emulator. aborting

it's when I try to run the application again after the emulator.exe is already dangling in Taksmanager.

Update: waited for 20mins. emulator.exe is just sitting there with 00:00:00 cpu time.

Best Answer

I had a smiliar problem in MacOS Sierra 10.12.4 and Android Studio 2.3.1.

I tried everything, I uninstalled and reinstalled Android Studio, rebooted the computer, cleared the .android folder and created a new avd image. Nothing helped me, but finally I ran this command (See more in Android Documentation):

emulator -partition-size 512 -avd avd_name 

And I received this error:

emulator: WARNING: encryption is off
Hax is enabled
Hax ram_size 0x40000000
HAX is working and emulator runs in fast virt mode.
Failed to sync vcpu reg
Failed to sync vcpu reg
Failed to sync vcpu reg
Failed to sync HAX vcpu contextInternal error: Initial hax sync failed 

With that, I discovered that my solution was to stop Docker-Machine, and, like magic, it solved the problem.