重置android网络,android – stream重置:PROTOCOL_ERROR,同时在3G网络中使用Retrofit

大家中午好!

我在我的应用程序中使用Retrofit进行网络调用.该应用程序真的很好,速度很快.感谢精彩的图书馆.但是,它只适用于Wi-Fi.如果我在3G网络中运行应用程序,则抛出错误.流被重置:PROTOCOL_ERROR,同时在3G网络中使用Retrofit

我已将此jar文件导入构建路径:

这是完整的堆栈跟踪:

11-17 16:01:54.017: D/Retrofit(3595): java.io.IOException: stream was reset: PROTOCOL_ERROR

11-17 16:01:54.017: D/Retrofit(3595): at com.squareup.okhttp.internal.spdy.SpdyStream.getResponseHeaders(SpdyStream.java:146)

11-17 16:01:54.017: D/Retrofit(3595): at com.squareup.okhttp.internal.http.SpdyTransport.readResponseHeaders(SpdyTransport.java:109)

11-17 16:01:54.017: D/Retrofit(3595): at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:676)

11-17 16:01:54.017: D/Retrofit(3595): at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:426)

11-17 16:01:54.017: D/Retrofit(3595): at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:371)

11-17 16:01:54.017: D/Retrofit(3595): at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:466)

11-17 16:01:54.017: D/Retrofit(3595): at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)

11-17 16:01:54.017: D/Retrofit(3595): at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)

11-17 16:01:54.017: D/Retrofit(3595): at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:73)

11-17 16:01:54.017: D/Retrofit(3595): at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38)

11-17 16:01:54.017: D/Retrofit(3595): at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:321)

11-17 16:01:54.017: D/Retrofit(3595): at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)

11-17 16:01:54.017: D/Retrofit(3595): at $Proxy0.getLoginCredentials(Native Method)

11-17 16:01:54.017: D/Retrofit(3595): at com.connected.merchant.SignIn$SignMeIn.doInBackground(SignIn.java:197)

11-17 16:01:54.017: D/Retrofit(3595): at com.connected.merchant.SignIn$SignMeIn.doInBackground(SignIn.java:1)

11-17 16:01:54.017: D/Retrofit(3595): at android.os.AsyncTask$2.call(AsyncTask.java:288)

11-17 16:01:54.017: D/Retrofit(3595): at java.util.concurrent.FutureTask.run(FutureTask.java:237)

11-17 16:01:54.017: D/Retrofit(3595): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)

11-17 16:01:54.017: D/Retrofit(3595): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)

11-17 16:01:54.017: D/Retrofit(3595): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)

11-17 16:01:54.017: D/Retrofit(3595): at java.lang.Thread.run(Thread.java:841)

11-17 16:01:54.017: D/Retrofit(3595): ---- END ERROR

谷歌没有帮助我.如果你帮我解决这个问题真的很棒.谢谢.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值