3

I am uploading the image to the server using Retrofit with Okhttp. Everything works fine but I am getting socket exception only with the Nexus 5X and 6P devices.

Exception that I am getting:

java.net.SocketTimeoutException: failed to connect to backup.server.gcm.com (port 8067) after 10000ms

Fixes that I tried:

  1. Changing tcp_timestamp by sysctl from server side.
  2. Added '/' slash at the end of url (As per the StackOverflow solution that i found).
  3. Added android:vmSafeMode="true" in application manifest (As per the Github solution in issues).

I almost tried all the possible solutions from my side and nothing works. I am completely stuck with this weird behaviour. Please help me for the same. Any kinda tip and suggestion would be really helpful to me. Also i found issues related this in github which are not unanswered as follows:

https://github.com/square/okhttp/issues/1771

https://github.com/square/okhttp/issues/2794

build.gradle

dependencies {
    compile 'com.squareup.retrofit2:converter-gson:2.0.1'
    compile 'com.squareup.okhttp3:okhttp:3.2.0'
    compile 'com.squareup.retrofit2:retrofit:2.0.1'
}
Chandru
  • 5,954
  • 11
  • 45
  • 85
  • Create a *reproducible test case* and file your own issue. By "reproducible", I mean that the issue contains **everything** that would allow anyone else with a similar device to experience the same symptoms. Particularly for cases like this, where the behavior is tied to specific hardware and a specific server, a reproducible test case is the only way anyone has of addressing your problem. If you do not wish to do that, switch away from the Square stack to something else (e.g., Volley) and hope that you wind up with fewer problems. – CommonsWare Aug 25 '16 at 11:22
  • @Chandru did you find any solution? – inthy Sep 22 '16 at 16:22
  • No. I didnt find any solution. There is some issues in Retrofit with Nexus devices. Now i am using default HTTPUrlConnection for upload. – Chandru Sep 24 '16 at 09:19

0 Answers0