-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected response code 200 only on emulator #92
Comments
Would you be able to provide the full stack trace / exception beyond just entityToBytes? (i.e. by modifying the line of code that logs "Unexpected response code" to include the IOException as well). It sounds like the HTTP stack you are using is what's failing. Which one is it - have you tried using a different one? Would also be good to know the emulator version you are using, and ideally, some sample code that reproduces the issue that we could run to investigate further, if possible. |
Thank you for the quick response! The caller of the entityToBytes is performRequest from the same class, BasicNetwork. I've attached 2 screenshots, one of them is the stack trace. The simulator I use is: Sample code:
Thanks! |
So HurlStack is more or less just a thin wrapper around HttpUrlConnection. The EOFException is presumably coming from there when trying to make the connection. I don't think there is much that Volley can do about this, short of applying a safe workaround if there's a known platform bug. The stack traces of the cause chain would be good to look at, since the exception is being thrown by some platform class under the covers. Otherwise, I suspect you would reproduce the same issue if you just used HttpUrlConnection directly, which means there's unfortunately not much Volley can do. Searching for the exception indicates a number of potential issues such as https://stackoverflow.com/questions/35990044/android-httpurlconnection-url-doesnt-work-on-emulator indicating networking issues on the machine in question which explained why it was emulator only. |
My thoughts were the same...most probably the issue is related to the PC's network. I will also try to reproduce it on my MAC (and I think it will not reproduce, just as on a real phone). From my point of view the issue can be closed now. |
Hey I got this error, but not in emulator, I'm running on real device |
Hey. did u find the solution for that |
Hi,
I get the following error from time to time (only on emulator):
BasicNetwork.performRequest: Unexpected response code 200.
The error is thrown from the BasicNetwork class line 238 (when trying to read from the HttpEntity.getContent input stream - method entityToBytes(HttpEntity)).
I must mention I do not use any proxy when communicating with the backend; the backend is accessed via wireless router - my PC and the backend are in the same network.
Also, I checked the backend logs and the response was properly sent, so no idea why this error happens.
I use Volley 1.0 (compile 'com.android.volley:volley:1.0.0')
Thanks,
Alex.
The text was updated successfully, but these errors were encountered: