Retrofit / OkHttp api调用未完成:“读取:意外EOF!”打印

问题描述 投票:4回答:1

我正在使用Rx批量请求到api。目前正在进行5次通话。我的代码中有一行在响应返回时打印出来。执行代码时,我经常发现只打印了4行,这意味着并非所有5个调用都已完成。看看logcat,我看到以下消息:

读:意外的EOF!

我在github上遇到过这个问题:https://github.com/square/retrofit/issues/1228

我尝试在正在使用的@GET请求之上添加@Streaming,但这似乎没有解决问题。

我在哪里可以开始调试这个问题,可能是什么问题?

android retrofit2 okhttp3
1个回答
4
投票

我在这里找到了一个解决方案https://sites.google.com/site/zhuoweisite/blog/fixingreadunexpectedeoferrorwhenusinglogcatonandroid80

在终端上执行此命令

adb logcat -G 1m
© www.soinside.com 2019 - 2024. All rights reserved.