首页 > 解决方案 > App doesn't install on the emulator and stuck on "Waiting for target device to come online"

问题描述

Yesterday I was prompted by studio to update something, can't even remember exactly what it was. From there, I "fell" into a chain of upgrades one after the other, when at it's end I was running gradle 3.5 Canary. Since then I am having a hard time having a fully synced work environment and can't run my app on the emulator.

I've downgraded my gradle back to 3.4, and installed devices again with api level 28 (instead of Q at the end of the previous chain of updates), and I can't get the app to install on the device.

When I click the run button I have either emulator 5554[offline] under Connected Devices or the actual device I've installed which is Pixel 2 API 28 under Available Virtual devices.

When I choose the second, I get a message telling me that the device is already running. That was never an issue before and running would just re-install and update the app to its latest version.

I read a solution suggesting to delete the folders and files with the extension .lock in the device's folder, but that was impossible when the emulator was running, and when I closed it they weren't there anymore so I assume that is working properly and is not the problem.

If I close the emulator completely and run it, then only the option of the pixel phone under Available Virtual Devices is present. When I choose it and run, it starts the emulator but it says Waiting for target device to come online.. and I can see that the device is off (black screen). When i turn it on, the message is still there and nothing happens. Then the only option I have is to cancel the process and run again, but then it goes back to the first problem I've mentioned (device is already running..)

How do I solve this?

Update: I've tried to see it through and give it about 5-10 minutes and then the message dissapears but the app still doesn't exist on the device.

I've checked and my AVD is updated. I've deleted the emulator and installed a new one. Still does't work.

标签: androidandroid-studioandroid-emulator

解决方案


推荐阅读