this one helps. Quite a lot differs! Using AsyncTask for HTTP requests is pretty much one of the worst things you can do on Android. It's fraught with problems and gotchas that are best unconditionally avoided. For example, you cannot cancel a request during execution. The patterns of using AsyncTask also commonly leak a reference to an Activity, a cardinal sin of Android development.
OkHttp Request is not public in com.squareup.okhttp; cannot be accessed from outside package
it should still fix some issue Looks like the line compile files('libs/GlassVoice-xe22.jar') was causing the issue, I guess it contains an obsolete version of OkHttp because once I removed that line the code worked fine.
Okhttp timeout exception after 10 secs even though I have given 30 minutes as timeout.