2

Trying to execute the following line

NsdManager Mgr = (NsdManager)Ctxt.getSystemService(Context.NSD_SERVICE);

in the Android 5.0 emulator (ARMv7a, on Win64) freezes the emulator. The debugger never reaches the next line, the emulator doesn't respond to buttons, can be only closed.

Tried from both a background thread and from the main one. The context is an Activity.

Permissions in the manifest include:

  • android.permission.INTERNET
  • android.permission.ACCESS_WIFI_STATE
  • android.permission.CHANGE_WIFI_STATE
  • android.permission.CHANGE_WIFI_MULTICAST_STATE

The same line works as expected on a 4.4 emulator and on a 4.1 device. Any ideas what's different on 5.0 and/or what's wrong with the line, please? Did anybody try this on a 5.0 device?

EDIT: same on Intel emulator.

Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281
  • It gets stuck after running a few times successfully on a KitKat emulator. I have to reboot the emulator. – Hong Jan 19 '16 at 20:41

1 Answers1

3

NSD in Android is all kinds of broken. Don't even try to make it work, go back to JmDNS.

These are the damning bug reports:

https://code.google.com/p/android/issues/detail?id=35585 https://code.google.com/p/android/issues/detail?id=39750

Also, Nsd Manager Android Crashing on 4.2.2

Community
  • 1
  • 1
Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281