google / android-emulator-m1-preview

Apache License 2.0
1.83k stars 161 forks source link

Android Studio is infinitely Waiting for device to come online . #47

Open ramanic opened 3 years ago

ramanic commented 3 years ago

When I run the app from android studio , emulator starts and run but the app cannot be installed because android studio is showing Waiting for device to come online message,I waited for an hour but its still showing same message ,emulator is completely started and working fine. I tried restarting abd server reinstalling emulator nothing is working . I tried the command adb devices the emulator is displayed offline.

How can I fix the adb device offline issue ?

hazem3ly commented 3 years ago

I also have the same issue

hannesa2 commented 3 years ago

This comes with x86 Emulator as well. Most of the time, a reboot of Android Studio and Emulator solves it for me.

ramanic commented 3 years ago

This comes with x86 Emulator as well. Most of the time, a reboot of Android Studio and Emulator solves it for me.

I tried restarting emulator, android studio and my laptop too, I even deleted and created new emulator .. sill getting the issue.

hazem3ly commented 3 years ago

This comes with x86 Emulator as well. Most of the time, a reboot of Android Studio and Emulator solves it for me.

I tried restarting emulator, android studio and my laptop too, I even deleted and created new emulator .. sill getting the issue.

i also have uninstalled android studio and install it again, also uninstalled android emulator and re-install but not working

hazem3ly commented 3 years ago

I have made it work but without the version from AVD manager, what I have done is downloaded Initial Preview v3: Google APIs System Image and added this emulator to applications and run android studio

hannesa2 commented 3 years ago

Hmm, maybe it depends on installation way ? I did it like this https://github.com/741g/android-emulator-m1-preview/issues/10#issuecomment-773545412

hazem3ly commented 3 years ago

Hmm, maybe it depends on installation way ? I did it like this 741g/android-emulator-m1-preview#10 (comment)

as I understand from the way you used to install manually without avd manager, and then moved the downloaded emulator to Library/Android/sdk is this the same emulator we download from avd manager or another one?

makaracc commented 3 years ago

Not sure if it is the right way, but I got that fixed by download and run it on InteliJ (universal) instead of Android Studio and my Emulator is (v.03).

LdrPontes commented 3 years ago

Same here.

jwcross commented 3 years ago

I'm running into this as well, so much love if someone figures it out

rajBopche commented 3 years ago

This is pain.

hannesa2 commented 3 years ago

I opened a Google issue https://issuetracker.google.com/issues/189615411 (please star it, to show Google this is a real issue !)

Inside there is my current workaround

I was able to solve it my complete re-install of ~/Library/Android/sdk

But curious, I installed Android Studio Bumblebee | 2021.1.1 Canary 2 and now I can debug again.

rajBopche commented 3 years ago

Somethings weird, the m1-preview emulator fails to connect to internet/wifi too. Is it just me?

hannesa2 commented 3 years ago

Somethings weird, the m1-preview emulator fails to connect to internet/wifi too. Is it just me?

Just you

wem2017 commented 3 years ago

I also have the same issue on Mac m1

invention64 commented 2 years ago

I have the same issue on windows 10, where the device is clearly working and online but the bar is still scrolling. Sometimes rebuilding and restarting work, but it happens so frequently that it ruins development flow.

Slion commented 2 years ago

Had a similar issue with Android Studio Arctic Fox 2020.3.1 Patch 3 on Windows 10. It would just freeze frequently after doing a build and run targeting a connected device. It seems that cleaning up my source tree fixed the issue. Just delete .gradle .idea and other build folders and reload your project in a brand new Android Studio environment. Nothing to do with Apple M1 emulator though obviously. However I landed here after searching online for this issue and apparently I'm not the only one.

ghost commented 2 years ago

This issue comes to me after I relocate Android Studio with all folders like .android, .gradle. From C to D disk. I resolved that so Environment variables ANDROID_AVD_HOME--------D:\Your_Profil\AppData\Local\Android\avd ANDROID_SDK_HOME--------D:\Your_Profil\AppData\Local\Android GRADLE_HOME ---------------D:\Your_Profil\AppData\Local\Android.gradle In Android studio -> file -> settings ->build ->build tools -> gradle -> gradle user home. And watch for that files adbkey and adbkey.pub they should to be in D:\Your_Profil\AppData\Local\Android Without them emulators with Play store wouldn't work. And click periodically wipe data. I hope I helped.

alihusseinalissa commented 2 years ago

I solved it by changing the regional format to English.

Go to Windows Settings -> Language and region, and change it to "English (United States)"

Seferi commented 2 years ago

I just updated to Bumblebee and the emulator is stuck at "connecting to the emulator".. I tried deleting the emulators and creating new ones. Nothing worked...

thanosbellos commented 2 years ago

Mac m1 here, i removed everything android related from my machine. i installed a fresh copy of android studio bumblebee and i face the same issue. The emulator cannot start. It's stuck in "is stuck at "connecting to the emulator". Activity monitor shows a 100% cpu usage of the "qemu-system-aarch64" process, also marked as not responding.

After 300seconds i see a timeout error.

wojewski commented 2 years ago

@Seferi, @thanosbellos This solution worked for me

ajgr commented 2 years ago

Just verified that a clean install of Bumblebee as well as an upgrade of Arctic Fox to 2021.11.20 result in this behavior on MacBook Air M1. Same thing if installing both versions in parallel. Also, after Bumblebee install or upgrade Arctic Fox will now exhibit the same bug in perpetuity.

The solution above (wojewski) is not really a solution. The emulator processes are actually launched and turn up right away in Activity Monitor as red runaways. Launching the emulator as its own app instead of in the IDE just gives the system a way to force-kill it to then send a report to Apple. Every time!

This is a well-known defect, unfortunately no one cares. I mean they must have installed BumbleBee on at least one MacBook in testing.

xrad commented 2 years ago

It's even funnier given the fact that all Google employees are using Macs in literally every presentation. This should be the best supported platform. Alas, on my Dell XPS this particular issue does not show up, but instead Studio isn't able to propely launch the ADB bridge and I have to do it manually. Seems to me like Bumblebee should have stayed in beta for some more time.

xrad commented 2 years ago

In https://issuetracker.google.com/issues/216675028 someone from Google acknowledges this and says a fix is in testing.

c4augustus commented 2 years ago

"never upgrade, never upgrade, never upgrade". I rolled the dice and paid the price. Generally once I have a stable setup I don't touch it. But all the tech companies keep us on a constant upgrade treadmill so that the ground is never stable. Add to that, we are all basically unpaid QA testers because any new release is really an alpha/beta. Now I cannot debug the app in the emulator.

hannesa2 commented 2 years ago

@c4augustus You could relax if you have a backup mechanism (e.g Time Machine on macOS). I prefer to rarely rollbacks instead of stagnation.

c4augustus commented 2 years ago

@hannesa2 I am on Windows, but I do have a second Windows computer with the previous version of Android Studio. I am now replacing my new installation with the old one from there. I also have a really old version of Android Studio on another computer running macOS to make sure that the app still works with the older toolset. I don't know why I bother to upgrade when every time that I do results in a work-breaking change.

sonusourav commented 2 years ago

For the time being, m1 chip users can do the following:

hogaurkumu commented 2 years ago

So convenient to install the Dolphin Preview and see it working. I am wondering why is it not fixed in the Bumblebee itself in the first place. And all this while I was wondering what I was doing wrong.

top-master commented 2 years ago

2022; One year later, but same behavior with latest Android Studio (at time of writting, Chipmunk 2021.2.1).

I could pin down the error to be latest "platform-tools" related, further more, only it's "adb.exe" file was the root cause.
I did downgrade "platform-tools", and anyone who does not want to downgrade:
simply killing the adb process will cause Android Studio to restart adb, but this time without here discussed issuse!!

hannesa2 commented 2 years ago

This only happen to me, when I've more the one Android Studio, or any other Intelij product, open

arthurbryant commented 2 years ago

This still happening on my Android Studio: BumbleBee (physical device) image

hifarhanali commented 2 years ago

I am facing the following issue.

Screenshot 2022-06-09 at 1 27 23 PM

I have tried every possible solution listed on StackOverflow, but it's not working. I have tried the following approaches:

1- Deselect Emulator from SDK tools and reinstall it. 2- Use a new emulator image. 3- Delete emulator instances from the activity monitor. 4- Reinstall the Android Studio. 5- Use previous versions of Android Studio.

malotur commented 1 year ago

I know it's late but i solved by disabling IPv6. Added this line: -Djava.net.preferIPv4Addresses=true to the custom VM options

DustinJoshua commented 1 year ago

In the Device Manager tab I clicked the the down arrow beside my device and tried "Cold Boot Now". Seemed to work for me, so I thought I'd see if it helps anyone else. Cheers.

gunrosen commented 1 year ago

I know it's late but i solved by disabling IPv6. Added this line: -Djava.net.preferIPv4Addresses=true to the custom VM options

Thank you. It works, save my time a lot.

igodogi commented 1 year ago

"Tools"-"Troubleshoot device connections" Follow the giude: "Rescan devices"-"Enable USB debugging"-"Restart ADB server"-Finish

It helps me a lot, maybe is helpful to you guys.

edelicht commented 1 year ago

In the Device Manager tab I clicked the the down arrow beside my device and tried "Cold Boot Now". Seemed to work for me, so I thought I'd see if it helps anyone else. Cheers.

Thanks a lot! This is the only thing that worked to me

makeking commented 1 year ago

We need to run the code on Android 4.3. Due to hardware problems and code problems, my program runs very slowly, so when I encounter this problem, I am very confused. I don’t know whether it is caused by poor hardware or too new programs. of.I am using the fox version of Android studio here image