我在 GooglePlay 中有一个应用程序,它是在大约 6 个月前发布的,直到今天它每次都运行良好。
从一天到另一天没有任何代码修改,我得到了这个错误:
12-07 14:51:09.646: W/System.err(23695): java.net.SocketTimeoutException: Connection timed out
12-07 14:51:09.673: W/System.err(23695): at org.apache.harmony.luni.platform.OSNetworkSystem.connect(Native Method)
12-07 14:51:09.673: W/System.err(23695): at dalvik.system.BlockGuard$WrappedNetworkSystem.connect(BlockGuard.java:357)
12-07 14:51:09.677: W/System.err(23695): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:204)
12-07 14:51:09.677: W/System.err(23695): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:437)
12-07 14:51:09.677: W/System.err(23695): at java.net.Socket.connect(Socket.java:1002)
12-07 14:51:09.681: W/System.err(23695): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:75)
12-07 14:51:09.681: W/System.err(23695): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:48)
12-07 14:51:09.681: W/System.err(23695): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:322)
12-07 14:51:09.685: W/System.err(23695): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
12-07 14:51:09.689: W/System.err(23695): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
12-07 14:51:09.689: W/System.err(23695): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
12-07 14:51:09.689: W/System.err(23695): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018)
12-07 14:51:09.689: W/System.err(23695): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:512)
12-07 14:51:09.692: W/System.err(23695): at java.net.URL.openStream(URL.java:645)
12-07 14:51:09.696: W/System.err(23695): at com.MyPackageName.XML.MyDownloadingTask.doInBackground(MyDownloadingTask.java:95)
12-07 14:51:09.696: W/System.err(23695): at com.MyPackageName.XML.MyDownloadingTask.doInBackground(MyDownloadingTask.java:1)
12-07 14:51:09.704: W/System.err(23695): at android.os.AsyncTask$2.call(AsyncTask.java:185)
12-07 14:51:09.708: W/System.err(23695): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
12-07 14:51:09.708: W/System.err(23695): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
12-07 14:51:09.708: W/System.err(23695): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
12-07 14:51:09.708: W/System.err(23695): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
12-07 14:51:09.708: W/System.err(23695): at java.lang.Thread.run(Thread.java:1019)
我没有更改代码中的任何一行,现在我的应用程序无法正常工作。它与启动时的 url 连接有关,所以现在它对这个愚蠢的、从无处出现的错误没有任何作用。
从浏览器我可以到达想要的 url,所以服务器是可靠的......
请,如果有人知道它是什么,请帮助我。谢谢,亚当