Waiting for Target Device to Come Online
I recently updated to Android Studio 2.3, and now when I try to run the application, the emulator does not come online. It times out after 300 seconds.
Additionally, The app has been experiencing a FATAL EXCEPTION ERROR (OOM), and I am not sure how to fix that either, or if that is part of the emulator problem.
Any help is much appreciated. Again, my knowledge in the program is very limited so if your answer can be kept simple, that would be great.
Solution 1:
Following worked for me on Android Studio 3.x.
Step 1: Open AVD Manager.
Step 2: Right click and Wipe data for the virtual device you're testing on.
Solution 2:
I too had the same problem, then I went to AVD manager and right click on the emulator and stopped it and I RUN the application again and this time it worked. It may be a temporary solution but works for the time being.
Tools -> AVD manager -> right-click on the emulator you are using -> Stop
Now Run
your application again.
Note: Sometimes closing the emulator directly is not working for the above-mentioned problem but stopping it from the AVD manager as mentioned is working.
Solution 3:
In case you are on Mac, ensure that you exit Docker for Mac. This worked for me.
Solution 4:
Three days on this, and I believe there's a race condition between adb and the emulator. On a request to run an app, with no emulator already running, you see the "Initializing ADB", then the emulator choice, it starts and you get "Waiting for target to come online". An adb kill-server, or a kill -9, or an "End Process" of adb with the task manager will cause adb to die, restart, your APK installs and you're good to go. It does seem funky to me that an "adb kill-server" causes adb to die and then restart here, but that's another mystery, maybe.
Solution 5:
-
Another case is Android Emulator should be reinstalled. This can happen, when you install a higher version of Android Studio, then update SDK for it, and go back to previous one.
Tools - Android - SDK Manager - SDK Tools - Android Emulator - uncheck, apply, check, apply
Disable Docker app if you have it (Mac users).
-
Restart emulator:
Tools - Android - AVD Manager (or kill adb process in task manager).