Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator not starting at all

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.

like image 639
boston Avatar asked Nov 18 '10 11:11

boston


People also ask

Why any emulator is not working?

If the Android Emulator does not start properly, this problem is often related to discovering that your application's minimum SDK is higher than your emulator SDK. If that's not the case, make sure you have HAXM installer on your SDK Manager.


4 Answers

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.

like image 90
carolnogueira Avatar answered Oct 21 '22 11:10

carolnogueira


I had this issued after upgrading Android Studio.

  • Open the AVD manager
  • Open the context menu for your image. (right click)
  • Select Cold Boot Now

ScreenShot

like image 31
Steven Spungin Avatar answered Oct 21 '22 11:10

Steven Spungin


When you say, "Everything worked fine yesterday", you should first ask yourself what you have changed since; have you installed anything that could interfere with the emulator?

Personally, I would download a fresh copy of the Android SDK, remove the reference to the currently installed version from your PATH, and add the new one.

I should think that would solve your issue (at least, being able to start an AVD that is).

One more thing to note is that the AVD can sometimes be quite slow to startup. On one of my machines, it has taken up to 7 minutes to boot up. So try emulator -avd avdname, then go make a coffee and see if it works when you return :)

Good luck!

like image 7
Jimmy Avatar answered Oct 21 '22 11:10

Jimmy


Well, I came across the same issue, I spent several hours uninstalling, re-installing, the DSK tools, and Eclipse individually, and also messed with the Bundle and the VM was simply not launching. Previous to that, I created a virtual machine, and worked fine for a day. What I did, was simply erased the .android folder from the C:\Users\USER\ folder and created a new virtual machine. It worked without any problems since then.

like image 7
user1908637 Avatar answered Oct 21 '22 11:10

user1908637