Android emulator not starting at all
Asked Answered
V

25

25

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.

Vestigial answered 18/11, 2010 at 11:47 Comment(5)
@boston: Have you tried restarting your computer?Teratism
@Patrick: yes. It doesn't help.Vestigial
@boston: If I remember correctly I had some similar issue when the .android folder was located at D:\.android instead of ~\.android (and they had to be exact copies of each other). Can you make a backup of the data in your .android user account folder and create a new emulator then?Teratism
Not sure what you mean by your first sentence? I cleared the .android folder at c:\users\username and created a new avd image. still nothing. Appreciate the help.Vestigial
@boston: What I meant was that the .android folder existed in more than one place on my computer. I can't verify it, but it was something about Eclipse wanting the .android folder on the same drive as my workfolder or something. If you only have the C drive on your computer then this is irrelevant.Teratism
N
7

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!

Nazar answered 18/11, 2010 at 12:56 Comment(4)
I asked myself that. But I just changed the code of my android project in Eclipse. Didn't tamper with the SDK. Just before you wrote this I downloaded the SDK again and copied it over the existing one replacing everything. This should have the same effect I guess? Still the emulator doesn't start. I know that it can take some time to start. I have seen that happen but I have never seen it not showing anything. I just see the running process in Taskmanager.Vestigial
I would place the new SDK somewhere else and update your system variables accordingly, in case there are any conflicts with whatever path you are using.Nazar
That did it :) Didnt think it would make a difference. Thank you!Vestigial
Great, glad to here it! (It was a bit of a wild guess if I'm honest ;) )Nazar
D
17

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.

Dryden answered 13/4, 2017 at 17:12 Comment(4)
Docker was my problem also. Thank you :)Laura
yes, got me yet again. Docker restarted when i rebooted hence why it "worked before" .. Thank you so much for this Reminder..!Tarim
Any idea why docker would get in the way of emulator??Cabaret
The docs mentioned this (look under VM acceleration restrictions). This applies to other virtualization software, too (including Virtualbox and VMWare).Cicatrize
H
16

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

Hartsfield answered 1/1, 2018 at 15:37 Comment(0)
N
7

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!

Nazar answered 18/11, 2010 at 12:56 Comment(4)
I asked myself that. But I just changed the code of my android project in Eclipse. Didn't tamper with the SDK. Just before you wrote this I downloaded the SDK again and copied it over the existing one replacing everything. This should have the same effect I guess? Still the emulator doesn't start. I know that it can take some time to start. I have seen that happen but I have never seen it not showing anything. I just see the running process in Taskmanager.Vestigial
I would place the new SDK somewhere else and update your system variables accordingly, in case there are any conflicts with whatever path you are using.Nazar
That did it :) Didnt think it would make a difference. Thank you!Vestigial
Great, glad to here it! (It was a bit of a wild guess if I'm honest ;) )Nazar
U
7

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.

Urchin answered 16/12, 2012 at 23:27 Comment(0)
E
4

Or : Window ->AVD Manager -> pick your virtual device ->Edit-> Snapshot(make sure is disabled) ->Edit AVD (try again, if still not working , then try to launch the emulator directly from AVD Manager -> Start).

Eusebioeusebius answered 4/10, 2012 at 17:30 Comment(0)
T
4

Enabling software graphic support instead of hardware worked for me.

Thinnish answered 16/3, 2017 at 8:9 Comment(2)
I have literally tried out thirty different stackoverflow thread's worth of responses and this seemingly random answer worked.Bonilla
If this answer worked for you and if you are running AMD GPU on Windows, check if GPU Workload is set to Graphics and not Compute. In my case, I had it set on Compute and it made emulator crash. When I changed it back to Graphics it got fixed.Rois
T
2

I tried the kill adb-server and start adb-server approach but it didn't work. I deleted my AVD and created a new AVD with the same configuration, and it worked. Hardly took 30 seconds.

Theodoretheodoric answered 12/6, 2012 at 22:23 Comment(0)
P
2

In linux:

Go to to your home directory

$cd ~/.android/avd 
$ls
$NexusS.avd/  NexusS.ini
$rm *.ini
$rm -rf NexusS.avd/      (don't use sudo and use TAB to bring in Nexus avd directory)

Restart eclipse and create new AVDs

Windows users should do the same in their user directory i.e C:/Users/FooBar/android/avd

Perseverance answered 30/1, 2013 at 9:31 Comment(0)
B
2

Faced a similar issue, mine was due to a space issue as the emulator wasn't able to launch.

Solution - Cleaned up system space and was able to launch the emulator

Bowden answered 21/12, 2020 at 16:3 Comment(0)
S
1

I faced with similar issue and something that worked for is, run the android virtual device manager and when you launch your AVD, remove the check start from the last snapshot.

I did this and it worked for me.

Schriever answered 9/8, 2012 at 6:37 Comment(0)
Z
1

most often deleting .android folder in user make the sense but

unbeleivable ,some of these types of problem may due to display drivers.. try switching drivers to dedicated graphics or reinstall main driver.. ...

Zenia answered 2/6, 2015 at 13:8 Comment(0)
W
1

After updating to windows 10 my graphics drivers started acting weird.

Disable the "Use Host GPU"

enabled the emulator to start for me

Weever answered 12/2, 2016 at 17:31 Comment(0)
S
1

For me the problem was that I ran android studio from terminal, with root.

When I opened studio normally from the applications folder and created a new AVD(the root one was not present), the AVD started.

Siloa answered 13/6, 2017 at 15:6 Comment(0)
B
1

I got it to work by doing the following:

  1. Right click on emulator in list.
  2. Select Wipe Data
Bruxelles answered 19/12, 2018 at 8:28 Comment(0)
T
1

firstly get name of your SDK's with

emulator -list-avds

Then you run command emulator -partition-size 512 -avd avd_name as carolnogueira recomended

for me it was not enought disk space, and after clear some unnecessary files, it worked fine

Terbecki answered 10/12, 2019 at 16:37 Comment(0)
L
1

It's not working sometimes when your disk free space ran out. Check that as well. My issue was lack of empty disk space.

Lanettelaney answered 2/5, 2020 at 6:19 Comment(0)
C
1

I want to run my apps on Android 11. So I downladed api 30 and started Emulator with recommended configuration.

But Emulator just exit with code 1 and not able to launch at all.

So after having few hours of spending time, I got SUCCESS after 2 steps.

  1. I did updated the Android emulator from SDK Tools.
  2. And Install x86 HAXM Installer and also manually install this exe file (haxm-7.6.5-setup) at following path:

C:\Users\HOME\AppData\Local\Android\Sdk\extras\intel\Hardware_Accelerated_Execution_Manager

That's it.

Coneflower answered 11/6, 2021 at 6:54 Comment(0)
K
1

I am using Linux and I found that running VirtualBox (with Windows) makes the Android Emulator fail silently. They are probably locking each other out of using virtualizaton, so the solution is to shut down any other virtual machines and remove all *.lock files.

Koniology answered 21/7, 2021 at 11:30 Comment(1)
OMG! Thank you. For last two days I was fighting with this on Arch linux, changing millions of paths, sdks, reinstalling staff etc. Just shutting down my VB (with linux guest) solved everything instantly!Stylographic
A
1

After trying many solutions that didn't work for me, I finally found one that solved mine.

The problem is my ANDROID SDK is not stored in the default location which is in D:\<A_folder>

I tried to run emulator -avd <avd_name> and resulted in an error that it can't find ANDROID_SDK_ROOT.

Solution:

Add ANDROID_SDK_ROOT to system env with the value of the ANDROID SKD folder location

Side note: If you don't know the avd name, you can run emulator -list-avds to list all the available avds enter image description here

Abhorrence answered 3/1, 2024 at 6:15 Comment(0)
Y
0

I faced a similar issue because there was not enough space in disk. So I deleted unwanted stuff and it worked for me.

Yellowknife answered 10/1, 2019 at 5:55 Comment(0)
I
0

May be you have created a new device that causing problem to start AVD. Delete that device and all will work fine.

Intermigration answered 14/1, 2019 at 5:10 Comment(0)
B
0

It happened to me after the Mac upgraded to Big Sur 11.5.2. Then I followed the link below resolved the issue. https://exerror.com/solved-qemu-system-x86_64-failed-to-initialize-hax-operation-not-supported-by-device-in-big-sur/

Apple has made changes to the hypervisor entitlements. They are key-value pairs that grant executable permission to use a service or technology. Create and put the entitlements.xml in the folder of darwin-x86_64 below and run the command at the folder, it should work.

codesign -s - --entitlements entitlements.xml --force /Users/username/Library/Android/sdk/emulator/qemu/darwin-x86_64/

enter image description here

and the content of entitlements.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>com.apple.security.hypervisor</key>
  <true/>
</dict>
</plist>
Balsa answered 13/10, 2021 at 14:8 Comment(0)
B
0

What solves my problem is going to the emulator device folder and deleting all the "image" files.

Bashemath answered 29/8, 2023 at 8:21 Comment(1)
You might want to give a few more details, did it help because of disk space? You might also want to add a warning on the fact that data will be lost.Tragicomedy
W
0

[Device doesn't open] [Windows "N"]

My virtual Devices from Android Studio stopped from working after I installed an "N" Windows 11 Iso, which comes without Windows media feature, after trying a lot of stuff, the only thing that worked for me was installing the Media Feature Pack

U can install it with the following steps:

Settings > Search for "Optional Features" > Add an optional feature > Search for "Media Feature Pack"

In windows 10, u can download direct from the web

Waterresistant answered 12/2, 2024 at 3:35 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Erosive
R
0

Had the same issue and find out that AVD not working without Microsoft Visual C++ 2015-2022 Redistributable (x64)

After installing Microsoft Visual C++ 2015-2022 Redistributable (x64) everithing works fine. AVD runs well.

Rushton answered 30/7, 2024 at 14:36 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.