Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/207.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在3G网络中使用改造时,流被重置:协议_错误_Android_Networking_Retrofit_Okhttp - Fatal编程技术网

Android 在3G网络中使用改造时,流被重置:协议_错误

Android 在3G网络中使用改造时,流被重置:协议_错误,android,networking,retrofit,okhttp,Android,Networking,Retrofit,Okhttp,大家中午好 我在应用程序中使用改装。该应用程序运行速度非常快。谢谢你的精彩图书馆。但是,它只能在wi-fi中工作。如果我在3G网络中运行应用程序,抛出错误流被重置:在3G网络中使用改装时出现协议错误 我已将此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/Retrof

大家中午好

我在应用程序中使用
改装
。该应用程序运行速度非常快。谢谢你的精彩图书馆。但是,它只能在wi-fi中工作。如果我在3G网络中运行应用程序,抛出错误<代码>流被重置:在3G网络中使用改装时出现协议错误

我已将此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

谷歌没有帮助我。如果你能帮我解决这个问题,那就太好了。谢谢。

看起来像是OkHtttp或您的Web服务器的SPDY或HTTP/2实现中的错误。升级至OkHttp/2.1。如果这不能解决问题,请在OkHttp的问题跟踪器上打开一个问题,并包括引起您悲痛的服务器的主机名。

我通过限制请求使用HTTP 1解决了类似问题,请参阅:

OkHttpClient okHttpClient = new OkHttpClient();
okHttpClient.setProtocols(Arrays.asList(Protocol.HTTP_1_1));

OkHttp-2.1帮不了我。你解决这个问题了吗?是的,我解决了,事实上,杰西帮了我,如果你需要解决方法,一定要提一下。这是okHttp Jar文件中的一个错误。你能提供解决方法的详细信息吗?@Shree请检查我想知道你为什么要使用旧版本。。