23

I am getting following error when running emulator, also debugging is not working, it says waiting for debugger to attach. I am wondering if the following has anything to do with getting stuck at "waiting for debugger to attach".

Emulator: E0516 21:01:34.057349753 3279 socket_utils_common_posix.cc:201] check for SO_REUSEPORT: {"created":"@1589644894.057229268","description":"SO_REUSEPORT unavailable on compiling system","file":"/mnt/tmpfs/src/android/emu-master-dev/external/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc","file_line":169}

My android studio version is below.

Android Studio 3.6.3 Build #AI-192.7142.36.36.6392135, built on April 14, 2020 Runtime version: 1.8.0_212-release-1586-b4-5784211 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 5.4.0-29-generic GC: ParNew, ConcurrentMarkSweep Memory: 1246M Cores: 4 Registry: ide.new.welcome.screen.force=true Non-Bundled Plugins:

4
  • same problem, found a solution? Commented May 18, 2020 at 11:44
  • No solution to resolve this error, but my debugging is now magically working on the same emulator
    – Ahmed
    Commented May 19, 2020 at 17:14
  • Having you given any thought about what changed? I just ran into the same problem after updating the 3.6.3 running on Ubuntu 18.4 Full error: 3:11 PM Emulator: E0524 15:11:34.211875852 15071 socket_utils_common_posix.cc:201] check for SO_REUSEPORT: {"created":"@1590347494.211844937","description":"SO_REUSEPORT unavailable on compiling system","file":"/mnt/tmpfs/src/android/emu-master-dev/external/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc","file_line":169}
    – Walt Corey
    Commented May 24, 2020 at 19:23
  • 3.6.3 was working fine, I just updated the emulator version and then this started to happen
    – Ahmed
    Commented May 24, 2020 at 20:18

8 Answers 8

2

I had that problem.

I was making a wrong diagnostic.

Running the emulator from Android/Sdk/emulator/emulator with a command such as:

./emulator @Pixel_3_API_28 -netdelay none -netspeed full -debug all also gave me this error, but it is non-blocking.

The problem disappeared when I:

  • switched to proprietary driver (nvidia) in Ubuntu in the Software Updater > Settings > Additional Driver

  • Restarting

  • Recreating my virtual device.

2
  • Which version are you using? I'm having the same problem and they are 2 propietary nvidia-driver-435 and nvidia-driver-440.
    – moxi
    Commented Jun 1, 2020 at 13:48
  • 1
    I'm using the nvidia-driver-440 (proprietary, tested). (I have a GeForce GTX 780 if this is relevant)
    – Luca
    Commented Jun 2, 2020 at 16:25
2

For me the device was working fine until this error started coming up.

Android Studio -> Open AVD Manager -> Select Virtual Device -> Wipe Data fixed the issue for me.

0

I think this is maybe related to fix in Emulator 30.0.18 (https://androidstudio.googleblog.com/2020/06/emulator-30018-canary.html). Try to update your emulator with different channel

sdkmanager --channel=3 "emulator"

For "waiting for debugger to attach" try to also delete all breakpoints if it helps.

ps: I am a bit duplicating my answer with https://stackoverflow.com/a/62793395/13891284 but can't really mark as duplicate

2
  • Could you say how to do it in Android Studio?
    – user5182503
    Commented Jul 26, 2020 at 20:24
  • Follow Update the IDE and SDK Tools but I don't think you can do it just for specific tool via IDE.
    – primus
    Commented Jul 28, 2020 at 13:05
0

I found a way to lauch emulator after understanding it was a GPU issue...

sudo ubuntu-drivers autoinstall

Changed problem to another :

Blockquote Error while Running Android Application - Could not initialize OpenglES emulation, use '-gpu off' to disable it

So according to this issue and this answer I changed the emulated device for one that allowed me to change 'Software-GLE 2.0' for Graphics,not select 'Automatic' or 'Hardware-GLE 2.0' (emulate graphics in software) (not all of them allow to change it) I used Galaxy Nexus API 30 - R and emulation worked, even I still have this SO_REUSEPORT error ! Hope it can help someone ...

0

The emulator was showing a android setup notification. Once I clicked on that and setup the phone, the emulator started working for me.

0

Switching the camera options from Emulated to None fixed it for me.

0

I had the same issue in Linux, Since I have two graphics card in my laptop, by default I was in powersave mode(Intel). Switching it to Performance mode(Nvidia) solved the issue for me.

0

The problem seems to be related to the Graphics settings - specifically if you choose Hardware GPU; Either disable the GPU or choose software emulation; Change it from the UI of the emulator, or directly in the config.ini file (in Linux at ~/.android/avd-emulator-name/config.ini):

hw.gpu.enabled=yes
hw.gpu.mode=software

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.