0

Hello I am calling API on my payment success event and send data on our server via API and it was working before but suddenly stop working below is my error and code

Error

failjava.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 2 column 1 path $

Code

 Gson gson = new GsonBuilder().setLenient().create();
        OkHttpClient.Builder okClientBuilder = new OkHttpClient.Builder().connectTimeout(1, TimeUnit.MINUTES)
                .readTimeout(1, TimeUnit.MINUTES);
        OkHttpClient okHttpClient = new OkHttpClient().newBuilder()
                .connectTimeout(30, TimeUnit.SECONDS)
                .readTimeout(30, TimeUnit.SECONDS)
                .writeTimeout(30, TimeUnit.SECONDS)
                .build();
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(Base_url.url)
                .client(okHttpClient)
                .addConverterFactory(GsonConverterFactory.create(gson))
                .build();
Twisha Kotecha
  • 1,063
  • 1
  • 2
  • 15
Sunil Meena
  • 45
  • 1
  • 5

0 Answers0