com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

Stack Overflow | Mohit Gaur | 11 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Online Dictionary api not working using retrofit

    Stack Overflow | 11 months ago | Mohit Gaur
    com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
  2. 0

    How to resolve gzip response

    GitHub | 1 year ago | xiaoxie
    com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

    Root Cause Analysis

    1. com.google.gson.stream.MalformedJsonException

      Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

      at com.google.gson.stream.JsonReader.syntaxError()
    2. Gson
      CollectionTypeAdapterFactory$Adapter.read
      1. com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1567)
      2. com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1416)
      3. com.google.gson.stream.JsonReader.doPeek(JsonReader.java:597)
      4. com.google.gson.stream.JsonReader.peek(JsonReader.java:429)
      5. com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:74)
      6. com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
      6 frames
    3. retrofit2.converter.gson
      GsonResponseBodyConverter.convert
      1. retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:37)
      2. retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:25)
      2 frames
    4. retrofit2
      ExecutorCallAdapterFactory$ExecutorCallbackCall.execute
      1. retrofit2.ServiceMethod.toResponse(ServiceMethod.java:116)
      2. retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:211)
      3. retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
      4. retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.execute(ExecutorCallAdapterFactory.java:89)
      4 frames
    5. com.mohit.dictionaryapp
      GetMeaningTask.doInBackground
      1. com.mohit.dictionaryapp.DictionaryApi.searchMeaning(DictionaryApi.java:33)
      2. com.mohit.dictionaryapp.GetMeaningTask.doInBackground(GetMeaningTask.java:27)
      3. com.mohit.dictionaryapp.GetMeaningTask.doInBackground(GetMeaningTask.java:13)
      3 frames
    6. Android Platform
      AsyncTask$2.call
      1. android.os.AsyncTask$2.call(AsyncTask.java:288)
      1 frame
    7. Java RT
      FutureTask.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:237)
      1 frame
    8. Android Platform
      AsyncTask$SerialExecutor$1.run
      1. android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
      1 frame