-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Fix for java.lang.ClassCastException in BinaryHttpResponseHandler #245
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
Conversation
Q: why are you using a BinaryResponseHandler, if you receive a String? cheers |
also: mb this is useful here: http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#getBytes%28%29 ? |
I'm using it for downloading images. I'm not sure why it is sometimes taken as a String! |
ah i c, that's odd indeed. Did you look at what happens in AsyncHttpRequest.makeRequest() ? |
This is where I am having a big problem. |
I used this patch and have been monitoring the crash reports. This patch worked! Referring relevant issues |
I also encountered the similar problem. |
@kakueki61 yes. if it was a failure, it used to give an exception. |
@kakueki61 that's right. |
Hi @rishabhmhjn I want to merge this pull request. |
I think I did it! Are you facing errors while merging? |
It doesn't look like youve done it. Can you try the following:
|
I realized that there is a conflict in
I have put my code in production and all the errors have gone. |
Actually @rishabhmhjn it looks like this bug has already been fixed with this commit: 7d10a63 |
Alright, great. |
Hi I think rishabhmhjn's proposal should still be taken into master build. When socket timeout occurs it still gives classcastexception. But with proposed fix which with toString cast seems to work ok. |
@loopj I'm still running into the classcastexception with the latest codebase. I'm using it to download images and when the phone has no connection (say airplane mode), it crashes everytime with a classcastexception. |
I get this exception often on some slow public wifi's. |
@k0rtess this issue should be fixed, if it appeared again, please create new issue and post full stacktrace. Thanks |
I've got loads of
ClassCastException
crash reports and this commit might fix the bug.I'm not yet sure of why this bug exists in the first place.
Please confirm this and let me know if I'm doing something wrong here.
Thanks