SocketTimeoutException in Retrofit
Increase the time if the fetching is taking more time use this code it worked for me OkHttpClient client = new OkHttpClient.Builder() .connectTimeout(100, TimeUnit.SECONDS) .readTimeout(100,TimeUnit.SECONDS).build(); Retrofit retrofit = new Retrofit.Builder() .baseUrl(“yourbaseurl”).client(client) .addConverterFactory(GsonConverterFactory.create(new Gson())).build(); hay this is a work around not the best practice , from comments down, Back end should not take this long and … Read more