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:
- Changing tcp_timestamp by sysctl from server side.
- Added '/' slash at the end of url (As per the StackOverflow solution that i found).
- 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'
}