android运行时出错

发布于 2021-11-16 22:14:02 字数 4506 浏览 882 评论 2

12-17 01:16:35.090: D/AndroidRuntime(775): Shutting down VM
12-17 01:16:35.090: W/dalvikvm(775): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
12-17 01:16:35.230: E/AndroidRuntime(775): FATAL EXCEPTION: main
12-17 01:16:35.230: E/AndroidRuntime(775): com.caucho.hessian.client.HessianRuntimeException: android.os.NetworkOnMainThreadException
12-17 01:16:35.230: E/AndroidRuntime(775):  at com.caucho.hessian.client.HessianProxy.sendRequest(HessianProxy.java:297)
12-17 01:16:35.230: E/AndroidRuntime(775):  at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:160)
12-17 01:16:35.230: E/AndroidRuntime(775):  at $Proxy0.Login(Native Method)
12-17 01:16:35.230: E/AndroidRuntime(775):  at android.view.View.performClick(View.java:4084)
12-17 01:16:35.230: E/AndroidRuntime(775):  at android.view.View$PerformClick.run(View.java:16966)
12-17 01:16:35.230: E/AndroidRuntime(775):  at android.os.Handler.handleCallback(Handler.java:615)
12-17 01:16:35.230: E/AndroidRuntime(775):  at android.os.Handler.dispatchMessage(Handler.java:92)
12-17 01:16:35.230: E/AndroidRuntime(775):  at android.os.Looper.loop(Looper.java:137)
12-17 01:16:35.230: E/AndroidRuntime(775):  at android.app.ActivityThread.main(ActivityThread.java:4745)
12-17 01:16:35.230: E/AndroidRuntime(775):  at java.lang.reflect.Method.invokeNative(Native Method)
12-17 01:16:35.230: E/AndroidRuntime(775):  at java.lang.reflect.Method.invoke(Method.java:511)
12-17 01:16:35.230: E/AndroidRuntime(775):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-17 01:16:35.230: E/AndroidRuntime(775):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-17 01:16:35.230: E/AndroidRuntime(775):  at dalvik.system.NativeStart.main(Native Method)
12-17 01:16:35.230: E/AndroidRuntime(775): Caused by: android.os.NetworkOnMainThreadException
12-17 01:16:35.230: E/AndroidRuntime(775):  at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:84)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.io.IoBridge.connectErrno(IoBridge.java:144)
12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.io.IoBridge.connect(IoBridge.java:112)

12-17 01:16:35.230: E/AndroidRuntime(775):  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)

12-17 01:16:35.230: E/AndroidRuntime(775):  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)

12-17 01:16:35.230: E/AndroidRuntime(775):  at java.net.Socket.connect(Socket.java:842)
12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpConnection.<init>(HttpConnection.java:76)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:341)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:315)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpEngine.connect(HttpEngine.java:310)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)

12-17 01:16:35.230: E/AndroidRuntime(775):  at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:188)

12-17 01:16:35.230: E/AndroidRuntime(775):  at com.caucho.hessian.client.HessianProxy.sendRequest(HessianProxy.java:295)

12-17 01:16:35.230: E/AndroidRuntime(775):  ... 14 more

 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

兮颜 2021-11-18 03:25:41

我的项目是android2.2的,用2.2的系统是正常的,其他系统就出这个问题!

天涯离梦残月幽梦 2021-11-17 01:05:00

回复
你试试低版本和高版本是什么情况,看看用到的方法有没有废弃,实用最新的api提供的方法。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文