Android Emulator gives an Error SO_REUSEPORT and debugging not working

放肆的年华 提交于 2020-08-06 07:26:05

问题


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:


回答1:


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:


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




回答3:


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 ...




回答4:


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




回答5:


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



来源:https://stackoverflow.com/questions/61839898/android-emulator-gives-an-error-so-reuseport-and-debugging-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!