“waiting for target device to come online” in Andr

2019-01-07 10:19发布

问题:

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:

And:

回答1:

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


UPDATE:

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



回答2:

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++


回答3:

if you docker is running you should close it.



回答4:

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"


回答5:

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



回答6:

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



回答7:

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.



回答8:

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.



回答9:

Restarting the computer solved it for me.



回答10:

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.



回答11:

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



回答12:

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



回答13:

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



回答14:

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.



回答15:

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.



回答16:

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.



回答17:

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



回答18:

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



回答19:

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.



回答20:

  • 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



回答21:

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.



回答22:

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

Or Try Cold Boot

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



回答23:

Try this.

Click on App-->Edit configuration

choose "Specified activity".

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

Then in "target" choose "open select deployment target dialog".

Click "Apply" then "Ok".



回答24:

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