android运行时出错
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的项目是android2.2的,用2.2的系统是正常的,其他系统就出这个问题!
回复
你试试低版本和高版本是什么情况,看看用到的方法有没有废弃,实用最新的api提供的方法。