Nsd Manager Android Crashing on 4.2.2

时光毁灭记忆、已成空白 提交于 2019-12-08 18:09:24

问题


Discovering services results in a system crash. The type of discover I am trying is

"_http._tcp."

Here's the log.

D/NsdService(13310): Discover services
E/AndroidRuntime(13310): *** FATAL EXCEPTION IN SYSTEM PROCESS: NsdService
E/AndroidRuntime(13310): java.lang.NullPointerException
E/AndroidRuntime(13310): at com.android.server.NsdService$ClientInfo.access$1200(NsdService.java:801)
E/AndroidRuntime(13310):    at com.android.server.NsdService$NsdStateMachine$EnabledState.requestLimitReached(NsdService.java:244)
E/AndroidRuntime(13310):    at com.android.server.NsdService$NsdStateMachine$EnabledState.processMessage(NsdService.java:292)
E/AndroidRuntime(13310):    at com.android.internal.util.StateMachine$SmHandler.processMsg(StateMachine.java:905)
E/AndroidRuntime(13310):    at com.android.internal.util.StateMachine$SmHandler.handleMessage(StateMachine.java:760)
E/AndroidRuntime(13310):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(13310):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(13310):    at android.os.HandlerThread.run(HandlerThread.java:60)

The code that I use for starting discovery is

NsdManager nsd = (NsdManager) getSystemService(Context.NSD_SERVICE);
nsd.discoverServices("_http._tcp.", NsdManager.PROTOCOL_DNS_SD, discoveryListener);

When I run, my phone restarts everytime. I guess this is a bug on Android 4.2.2


回答1:


I get it on my Nexus 7. Looks like it is already reported as a bug.

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



来源:https://stackoverflow.com/questions/15458323/nsd-manager-android-crashing-on-4-2-2

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