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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

This means you had a syntax problem in your serialization/deserialization, check the Gson javadoc to check the right syntax: https://goo.gl/g7LnZb

,
Expert tip

This seems to be a bug in the-blue-alliance, fixed in version 4.2.3 (link for github in case you want the changelog: https://goo.gl/NQAKUf ). If you're not using it, it might be that you're parsing xml as json.

Solutions on the web

via Stack Overflow by Mohit Gaur
, 1 year ago
Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
via GitHub by xiaoxie
, 1 year ago
Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
via Stack Overflow by Unknown author, 2 years ago
Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 12
via GitHub by maxme
, 5 months ago
Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 3409 path $
via GitHub by gikarasojo
, 3 months ago
Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
via GitHub by NeoLSN
, 1 year ago
Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 2 path $
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(JsonReader.java:1567)
at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1416)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:597)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:429)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:74)
at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:37)
at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:25)
at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:116)
at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:211)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.execute(ExecutorCallAdapterFactory.java:89)
at com.mohit.dictionaryapp.DictionaryApi.searchMeaning(DictionaryApi.java:33)
at com.mohit.dictionaryapp.GetMeaningTask.doInBackground(GetMeaningTask.java:27)
at com.mohit.dictionaryapp.GetMeaningTask.doInBackground(GetMeaningTask.java:13)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)

Users with the same issue

Once, 1 day ago
9 times, 4 months ago
Once, 5 months ago
Once, 10 months ago
Samebug visitor profile picture
Unknown user
Once, 11 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.