com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 44 path $.data

Stack Overflow | Usman Rana | 1 month 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

    Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path

    Stack Overflow | 4 months ago | Theo
    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
  2. 0

    Using Retrofit how to parse JSONArray without objects parsing?

    Stack Overflow | 1 month ago | Usman Rana
    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 44 path $.data
  3. 0

    hourly weather forecast using openweathermap api

    Stack Overflow | 23 hours ago | prem
    com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 1035.16 at line 1 column 138 path $.list[0].main.pressure
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Retrofit2 does not seem to handle multipart responses

    GitHub | 2 months ago | cdongieux
    com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
  6. 0

    Retrofit 2.0.1 Post JSON -- MalformedJsonException

    Stack Overflow | 12 months ago | Devan Carlson
    com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

    Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 44 path $.data

    at com.google.gson.stream.JsonReader.beginObject()
  2. Gson
    ReflectiveTypeAdapterFactory$Adapter.read
    1. com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)
    2. com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:213)
    3. com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
    4. com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
    4 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
    OkHttpCall$1.onResponse
    1. retrofit2.ServiceMethod.toResponse(ServiceMethod.java:117)
    2. retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:211)
    3. retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:106)
    3 frames
  5. okhttp3
    RealCall$AsyncCall.execute
    1. okhttp3.RealCall$AsyncCall.execute(RealCall.java:133)
    1 frame
  6. okhttp3.internal
    NamedRunnable.run
    1. okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
    1 frame
  7. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    3. java.lang.Thread.run(Thread.java:761)
    3 frames