54

Recently upgraded to Android Studio from 2.2.3 to 2., running on Win10

Emulator stopped working since then. Tried installing other images(25 rev 4)/upgrading for AVD but nothing seems to work. After running gradle and showing "waiting for target device to come online" in task bar nothing happens and program doesn't run.

Kindly help


Adding Screenshot:

enter image description here

And:

enter image description here

jww
  • 97,681
  • 90
  • 411
  • 885
fidelis
  • 543
  • 1
  • 4
  • 9
  • Have you killed your adb ? – MuTiny Mar 13 '17 at 06:58
  • 6
    try to **invalidate cache and restart** from `File` menu – Atef Hares Mar 13 '17 at 07:17
  • Already tried doing it... still no luck. – fidelis Mar 13 '17 at 07:34
  • 1
    see another solution : [disable / enable adb integration](http://stackoverflow.com/questions/42730396/android-studio-emulator-wont-start-waiting-for-target-device-to-come-online) – hcknl Apr 07 '17 at 12:12
  • 1
    Possible duplicate of [Error while waiting for device: Time out after 300seconds waiting for emulator to come online](http://stackoverflow.com/questions/36675654/error-while-waiting-for-device-time-out-after-300seconds-waiting-for-emulator-t) – rajat May 16 '17 at 01:21
  • This may sound ridiculous but after hours of trying many SO solutions what worked for me was to completely remove Android Studio and reinstall without importing any settings. See https://stackoverflow.com/a/18458893/1159930 – Markymark Aug 29 '21 at 16:13

29 Answers29

86

I was also having the same issue 2 days ago when i update my android studio, today I solve my issue when I was playing around with settings then I saw that in my SDK tools setting Android Emulator is uncheck so I simply checked that box and now emulator is working fine.

Try this steps may work for you also:

  1. Go to SDK tools > SDK Tools
  2. Check Android Emulator and click Apply

enter image description here


UPDATE:

There are changes, though it's installed, you might need to update

enter image description here

June7
  • 19,874
  • 8
  • 24
  • 34
Moiz Farooq
  • 1,018
  • 9
  • 11
37

I already have Emulator installed. But still had the same problem this morning with Ubuntu 16.04 and Android Studio 2.3,Below is what I did and it worked.

Double Check to see if these are available:

    sudo apt-get install lib64stdc++6:i386    
    sudo apt-get install mesa-utils
  1. Locate the lib64 folder. On Ubuntu 64 bit, its located under ~/Android/Sdk/emulator/lib64.

  2. In terminal, Navigate to the ~/Android/Sdk/emulator/lib64 folder ,then run the following commands:

move the libstdc++ file inside the folder libstdc++.bak and provide softlink

mv libstdc++/ libstdc++.bak
ln -s /usr/lib64/libstdc++.so.6 libstdc++
Nigel Ren
  • 56,122
  • 11
  • 43
  • 55
Neha Raj
  • 547
  • 5
  • 5
  • Following this answer solved the problem for me. No device was coming online after I upgraded to ubuntu 17.04 and at the same time I upgraded Android Studio to version 2.3.2. – Mohamed Ahmed May 30 '17 at 13:24
  • 4
    Fixed issue and gets the +1, but an explanation of *why* this works and/or what the actual problem causing it is would be appreciated. – Jared Smith Jun 12 '17 at 19:30
  • 2
    First of all, this trick doesn't solve this problem in my case. Plus I have some doubts here. As of Android Studio 2.3.3 both of your mentioned dependencies **lib64stdc++6:i386** and **mesa-utils** are already there in the emulator directory - **~/Android/Sdk/emulator/lib64/lib64stdc++** and **~/Android/Sdk/emulator/lib64/gles_mesa**. The file on **~/Android/Sdk/emulator/lib64/lib64stdc++** location is libstdc++.so.6. Why do I need to create symbolic links between these 2 location? – somnathbm Jun 26 '17 at 02:46
  • 2
    Neha Raj, thank you very much, the only solution that's worked for me. One suggestion though. However in my case all this had to be done in the ~/Android/emulator/lib64 directory. – kiwicomb123 Jul 28 '17 at 12:32
  • Fixed the issue in Kali Linux 2017.1, Android Studio 2.3.3... Thanks! – ArmaGeddON Aug 16 '17 at 16:16
  • This incomprehensible paganistic Linux blather solved my problem too! – Toby Wilson Aug 16 '17 at 18:09
  • Thanks it worked, can someone explain what did I do :)? – TomaC Sep 08 '17 at 18:43
  • work for me on ubuntu17.04 with android studio 2.3.3, thanks a lot, a little more explaination would be more great – Z.better Sep 26 '17 at 03:29
  • Thanks, not sure I would be able to figure this out without this answer :) – D.K. Oct 08 '17 at 22:30
20

None of these solutions worked for me. After removing and installing the emulator from scratch several times, and also SDK Tools, I saw under developer options in the emulator that USB debugging was not active.

  • Settings
  • About Emulator Device
  • Click several times on Build Number until it says that you are a developer
  • Go back
  • Get into developer options
  • Put a check on "USB debugging"
Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
lcompare
  • 917
  • 12
  • 10
  • 1
    This should be the accepted answer, it worked for me and is quite an undocumented way – Luka Govedič Jun 27 '18 at 12:02
  • Additionally I needed to open Tools->AVD Manager and STOP the running emulator. Then run the app and select the stopped emulator. When it starts there should be a prompt to "allow USB debugging" - select yes. That fixed it for me. – Lee Hounshell Jan 13 '19 at 02:33
18

if you docker is running you should close it.

volkan
  • 197
  • 4
  • I have tried by restarting my pc even. anything else i can try for? – fidelis Mar 14 '17 at 13:13
  • 1
    Offical answer; > You can't run software that uses another virtualization technology at the same time that you run the accelerated emulator. For example, VirtualBox, VMWare, and Docker currently use a different virtualization technology, so you can't run them at the same time as the accelerated emulator. [emulator-acceleration](https://developer.android.com/studio/run/emulator-acceleration.html#accel-vm) – volkan Apr 12 '17 at 04:53
11

I realized my emulator was actually frozen, despite restarting it and restarting my computer. I just had to wipe data (AVD Manager > right-click on emulator > Wipe Data) and it started working again. You'll lose any state you had, but at least you won't have to reinstall it.

Ken
  • 2,918
  • 1
  • 25
  • 31
6

First delete your exiting emulator than recreate it. Now run again hope it will fix your error.

Ahmer Afzal
  • 501
  • 2
  • 11
  • 24
  • deleted and recreated it... In fact downloaded other versions even to check if any issue with versions but still no changes... Emulator just dont come up. – fidelis Mar 13 '17 at 07:38
  • Add screenshot for further assistance – Ahmer Afzal Mar 13 '17 at 08:05
  • added... pls ask for any more info :) – fidelis Mar 13 '17 at 08:41
  • First time you're trying to running AVD? Try Genymotion Android Emulator, if it also won't working then update your Display driver or upgrade your PC. – Ahmer Afzal Mar 13 '17 at 08:47
  • No am not trying to run it for the first time... earlier it was working fine.. after i upgraded from android studio from 2.2.3 to 2.3 it stopped working.. and my os, display driver all is updated to latest versions. Is there is any way to log what is happening when it says **“waiting for target device to come online”** – fidelis Mar 13 '17 at 08:56
  • 1
    try http://stackoverflow.com/questions/42612468/how-can-i-get-more-information-about-waiting-for-target-device-to-come-online – Ahmer Afzal Mar 13 '17 at 09:05
  • No solution there and moreover its Linux based and am on Windows – fidelis Mar 13 '17 at 14:47
  • Is there is anyway i can delete all emulator data and re install it without removing complete Android Studio as no solution seems to work...? I had tried removing adb ie virtual devices listed and removing and re downloading android images used for emulation...!!! – fidelis Mar 13 '17 at 15:15
  • 3
    I recommend you install your new windows and reinstall it. – Ahmer Afzal Mar 14 '17 at 08:38
  • We need to be practical dude... just for trying an IDE if I have to reinstall everything then better leave it.... how come an IDE doesnt have option to track issue even... resolution is next...!!! – fidelis Mar 14 '17 at 13:15
3

I was experiencing the same issue where the emulator would start up but I would be left with a black screen and my app won't load up. Anyway, what I did was, I accessed the setting of the emulator. Make sure the "Save quick-boot state on exit for AVD Pixel_2_API_26" is set to "No". Note: My device is a Pixel 2, it could be different for other users. Extended Controls

Timetraveller
  • 304
  • 5
  • 18
  • How did you open up the settings? I can't seem to find it. – Attila Feb 26 '18 at 21:33
  • 2
    Have a look at the bottom right corner of the photo. Those 3 dots, once you click them, it should open the Extended controls window and Select the Settings tab. – Timetraveller Mar 09 '18 at 01:05
3

I had the same problem ,I was using

Linux LinuxRobot 4.14.0-kali3-amd64

and getting this

host doesn't support requested feature: CPUID.80000001H:ECX.abm

and this message

waiting for target device to come online

Solution Close debugging and current emulator then

Open Avd Manager ,you will be able to see your device there then click on play button

enter image description here

Or Try Cold Boot

Open Android virtual device manager,click on drop button after select cold boot. read this

enter image description here

TAHA SULTAN TEMURI
  • 4,031
  • 2
  • 40
  • 66
2

Try configuring different Android Emulator and using it while running. You current emulator may have some issues. It worked for me.

1

I had a similar problem when updated my android studio. Somehow it changed my SDK path. I just changed it to my updated SDK path and it worked.

Android Studio -> File -> Settings -> Appearance & Behaviour -> System Settings -> Android SDK

Here you will find Android SDK location just click on edit link in front of that and browse and select the Android SDK from the file browser. Select and click on Apply.

Select AVD manager and start Emulator. This solution worked for me.

1

If none of the previous answers solved your problem, I suggest you to check KVM errors. Even if you did not install KVM it's possible you to get KVM errors when you try to run x86 images. Open a terminal and type dmesg | grep kvm after starting emulator. This way you will be able to see if you get KVM errors.

On my Ubuntu 16.04 machine with Android Studio 2.3.3 installed on it, the problem was about KVM. Android Studio was trying to enable KVM for x86 images. When I try to start the emulator, dmesg showing errors "kvm: enabling virtualization failed." Although ARM images were working fine.

After installing KVM, I was able to run x86 images on emulator without errors.

If this is the problem you are encountering, you might want to checkout KVM installation page.

Görkem Mülayim
  • 1,139
  • 1
  • 12
  • 22
1
  • first delete your AVD from tools>avd manager
  • close android studio and restart computer
  • open android studio click on run button on toolbar and click on create new virtual device from there

worked for me

Hamidreza
  • 694
  • 6
  • 19
1

I had another Android emulator running in the background, completely separate from Android Studio. I saw it in the list when I loaded ADB, so it was detected for some reason, but I ignored it. Anyway, when I closed it, this error went away and I was able to load my app no problem. Specifically, I had BlueStacks loaded. So, if you use BlueStacks or another Android emulator, close that as that might be the problem.

Peter Griffin
  • 749
  • 9
  • 14
1

Try this.

Click on App-->Edit configuration enter image description here

choose "Specified activity".

enter image description here

Then in activity, choose your main activity(or whatever name you gave it), then click Ok. enter image description here

Then in "target" choose "open select deployment target dialog". enter image description here

Click "Apply" then "Ok".

Johira Afzali
  • 1,196
  • 11
  • 10
1

I couldn't get any solutions working and I tried almost every solution. What actually worked for me was something I accidentally stumbled upon. I opened two Android Studio applications and ran one and let it stay "waiting for target device to come online" and went to my other app that I want to run and run that but there will be an option under connected devices when you go to choose your avd, choose that one. It will connect to the avd you are using in the first app you ran and work.

jor2
  • 460
  • 2
  • 5
  • 21
1

For anyone who is having the issue now and non of the solutions worked. Try this:

I was having the same issue and it was actually caused by android Q preview. I created a device with Pie and everything just works.

Anna
  • 443
  • 9
  • 29
1

After trying Cold Boot and other stuff, I removed Android Emulator from SDK Tools, and then reinstalled. But first, I reinstalled HAXM too, because I recalled that I had an error message when installing by first time.

HAXM error

To install HAXM I had to disable Hyper-V on Windows 10, basically running:

bcdedit /set hypervisorlaunchtype off

like stated here: https://github.com/intel/haxm/issues/105#issuecomment-430484231

After that, I reinstalled Android Emulator. It's just unchecking the box, applying the change, checking it again and applying the change. But you can follow more detailed steps here: https://www.technipages.com/android-emulator-stuck-waiting-for-target-to-come-online

After that, I have my AVD running.

mayid
  • 1,644
  • 15
  • 23
0

After lots of attempts, stopping device from AVD(exactly from AVD, not by cross button nor power off button on emulator) and starting build again helped me.

Pavlus
  • 1,651
  • 1
  • 13
  • 24
0

Upgrade your Display driver ... this worked for me!

Russo
  • 2,186
  • 2
  • 26
  • 42
0

maybe you do not have SDK of your simulator,please check File->Settings->Appearance&Behavior->SystemSetting->Android SDK

kyle
  • 11
  • 1
0

I had to turn off Parallels Desktop and it started working again without reboot.

Vlad
  • 11
0

For me what was happening was the Virtual device never booted.

What fixed this was:

cd ~/.android/avd/<Name of virtual device>/
rm *.img

Then I restarted the virtual device and it came on line.

John LaBarge
  • 149
  • 1
  • 9
0

I tried doing a “Cold Boot Now” in the device, but got an error saying: AVD Pixel_API_24 is already running. If that is not the case, delete the files at /.android/avd/Pixel_API_24.avd/*.lock.

After deleting a .lock file in the suggested folder the “Cold Boot Now” worked and the device was back to normal.

Marilia
  • 1,911
  • 1
  • 19
  • 28
0

I have the same issue with the new update about Quick boot.

Unfortunately I had to disable it to make the emulator working again.

Android Studio -> tools -> Android -> AVD Manager -> edit your emulator -> Show Advanced Settings -> select Cold boot

Ahmad Melegy
  • 1,530
  • 1
  • 16
  • 18
0

I deleted all my AVD files and recreated an AVD.

  • (In windows), delete all files in C:\Users\MyName\.android\avd\
  • Android Studio > Tools > AVD Manager > Create Virtual Device ...
  • etc.

At this point in time I was on Win10, Android Studio 3.1.2

John Bentley
  • 1,676
  • 1
  • 16
  • 18
0

I solved by modifying my configuration on AVD.

1) Go to the AVD Manager

2) Click "Edit this AVD" Button (the pencil icon).

I had no device selected and it showed an error message that I need to select a device for the AVD to work. Once I did that and saved my emulator worked.

John81
  • 3,726
  • 6
  • 38
  • 58
0

Solved a similar issue by enabling USB debugging under developer settings in the emulator.

makunomark
  • 789
  • 6
  • 10
-1

Restarting the computer solved it for me.

Samil
  • 958
  • 1
  • 17
  • 20
-1

Setting the system variable ANDROID_SDK_ROOT to the path used by Android studio solved the issue for me:

  • In Android Studio fire up Tools>Android>SDK Manager, navigate to Appearance & behavior>System Settings>Android SDK

  • Copy the path from "Android SDK Location"

  • Add ANDROID_SDK_ROOT to your system variables and assign the path

  • Restart Android Studio

MR86
  • 11