java.lang.NoClassDefFoundError retrofit2.Utils

后端 未结 11 1383
梦毁少年i
梦毁少年i 2020-12-30 10:40

I\'m using Retrofit to handle the Serverside Data from Mobile. After Implementing retrofit, I am Getting the below Exception.

What am I doing wrong?

11条回答
  •  生来不讨喜
    2020-12-30 11:31

    mRetrofit = new Retrofit.Builder()
                        .baseUrl(AppConstance.APP_URL)
                        .addConverterFactory(ScalarsConverterFactory.create())
                        .addConverterFactory(GsonConverterFactory.create())
                        .client(getOkHttpClient())
                        .build();
    

    REWRITE TO

    OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
    mRetrofit = new Retrofit.Builder()
                            .baseUrl(AppConstance.APP_URL)
                            .addConverterFactory(GsonConverterFactory.create())
                            .client(httpClient)
                            .build();
    

提交回复
热议问题