Volley + OkHttp on Android gives error on status 200 response

跟風遠走 提交于 2019-12-05 08:39:46

I haven't had too much time to investigate but I was running into the same issue when using the emulator connected through a proxy (Charles). For me the problem goes away when I test without a proxy or on device.

This exact same problem happened to me when using the start and stop methods of the RequestQueue. It was pointed out in many popular blogs that the RequestQueue should be stopped when user is flinging to ensure there's no jerking. However when you call stop, all RequestQueue's requests are stopped, even the ones which were already doing network call. The above exception happened when these requests are stopped preliminarily. Not calling the stop function solved the problem for me.

For those people using a Proxy (in my case Charles) besides configuring your proxy in Settings it is necessary to configure also your proxy in the Android Emulator.

So, here is my configuration in Settings Emulator

And this are the steps to configure the proxy using wifi in Android Emulator

  1. Settings
  2. Network & Internet
  3. Wi-Fi
  4. Android Wifi
  5. Click on Setting icon
  6. Click Edit icon

  1. Configure your proxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!