简体   繁体   中英

what does this error mean ? (android)

12-19 18:29:33.203: ERROR/AndroidRuntime(402): FATAL EXCEPTION: main
12-19 18:29:33.203: ERROR/AndroidRuntime(402): java.lang.RuntimeException: Unable to start activity ComponentInfo{ayanoo.forms/ayanoo.forms.FullFriendView}: java.lang.NullPointerException
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.os.Looper.loop(Looper.java:123)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread.main(ActivityThread.java:3647)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at java.lang.reflect.Method.invokeNative(Native Method)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at java.lang.reflect.Method.invoke(Method.java:507)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at dalvik.system.NativeStart.main(Native Method)
12-19 18:29:33.203: ERROR/AndroidRuntime(402): Caused by: java.lang.NullPointerException
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at org.json.JSONTokener.nextValue(JSONTokener.java:90)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at org.json.JSONObject.<init>(JSONObject.java:154)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at org.json.JSONObject.<init>(JSONObject.java:171)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at ayanoo.forms.FullFriendView.fullProfile(FullFriendView.java:203)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at ayanoo.forms.FullFriendView.onCreate(FullFriendView.java:93)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
12-19 18:29:33.203: ERROR/AndroidRuntime(402):     ... 11 more
12-19 18:29:35.623: ERROR/InputDispatcher(60): channel '4067f010 ayanoo.forms/ayanoo.forms.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
12-19 18:29:35.623: ERROR/InputDispatcher(60): channel '4067f010 ayanoo.forms/ayanoo.forms.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
12-19 18:29:35.993: ERROR/InputDispatcher(60): Received spurious receive callback for unknown input channel.  fd=158, events=0x8

Looks like you tried to pass a String to JSONObject but instead passed null . JSONTokener is documented as throwing NullPointerException when constructed on null .

Also, if you're wondering why there are two stacktraces, it's because your Activity threw an exception in its onCreate method, so you see the stacktrace of your method and then a stacktrace indicating that the system could not create your activity. (If you're debugging with Eclipse, it ought to break at the correct line of code in your Activity .)

您调试包含“消费者关闭的输入通道或发生错误”,这是我在测试应用程序的脱机功能时关闭互联网时收到的。当然,服务器未返回您的JSON。...我建议您进行更多错误检查围绕这些功能...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM