24

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:

Ahmed
  • 14,503
  • 22
  • 92
  • 150
  • same problem, found a solution? – Stanly Medjo May 18 '20 at 11:44
  • No solution to resolve this error, but my debugging is now magically working on the same emulator – Ahmed May 19 '20 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 May 24 '20 at 19:23
  • 3.6.3 was working fine, I just updated the emulator version and then this started to happen – Ahmed May 24 '20 at 20:18

8 Answers8

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.

Luca
  • 21
  • 1
  • Which version are you using? I'm having the same problem and they are 2 propietary nvidia-driver-435 and nvidia-driver-440. – moxi Jun 01 '20 at 13:48
  • 1
    I'm using the `nvidia-driver-440 (proprietary, tested)`. (I have a GeForce GTX 780 if this is relevant) – Luca Jun 02 '20 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.

Gibreel Abdullah
  • 335
  • 1
  • 3
  • 12
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

primus
  • 30
  • 4
  • Could you say how to do it in Android Studio? – ThatsMe Jul 26 '20 at 20:24
  • Follow [Update the IDE and SDK Tools](https://developer.android.com/studio/intro/update) but I don't think you can do it just for specific tool via IDE. – primus Jul 28 '20 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 ...

Gauthier
  • 13
  • 5
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.

andras
  • 3,305
  • 5
  • 30
  • 45
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
Dima Kozhevin
  • 3,602
  • 9
  • 39
  • 52
elazarik
  • 11
  • 3