Answers for "at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.onFailure(DefaultCallAdapterFactory.java:96)"

0

at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.onFailure(DefaultCallAdapterFactory.java:96)

class RetrofitService {

    private val BASE_URL = "https://jsonplaceholder.typicode.com/"


    private val loggingInterceptor = HttpLoggingInterceptor()


    private val httpClient = OkHttpClient.Builder().addInterceptor(loggingInterceptor).build()

    private val builder = Retrofit.Builder()
        .baseUrl(BASE_URL)
        .addConverterFactory(GsonConverterFactory.create())
        .client(httpClient)

    private val retrofit = builder.build()

    init {
        loggingInterceptor.level = HttpLoggingInterceptor.Level.BODY
    }

    fun <S> createService(
        serviceClass: Class<S>
    ): S {
        return retrofit.create(serviceClass)
    }
}
Posted by: Guest on July-28-2020
0

at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.onFailure(DefaultCallAdapterFactory.java:96)

android {
    compileOptions {
        targetCompatibility = "8"
        sourceCompatibility = "8"
    }
}
Posted by: Guest on July-28-2020

Browse Popular Code Answers by Language