com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 5

Stack Overflow | Harish Dabade | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I am working on json and getting the error returned a response status of 400 Bad Request

    Stack Overflow | 6 months ago | Harish Dabade
    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 5
  2. 0

    Convert JSON String to different java Objects in java

    Stack Overflow | 2 years ago | jags kk
    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 14
  3. 0

    Create an object from JSON (GSON: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING)

    Stack Overflow | 4 years ago | user2144555
    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 226
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    store objects in android gson

    Stack Overflow | 4 years ago | ant
    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2
  6. 0

    Help!Forge 1.6.2 isn't working!

    minecraftforge.net | 1 year ago
    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 3583

  1. Nikolay Rybak 12 times, last 1 month ago
  2. justCodeit 11 times, last 2 months ago
  3. filpgame 4 times, last 2 months ago
  4. Emrah Küçük 9 times, last 4 months ago
  5. linxiaolong 4 times, last 4 months ago
19 more registered users
53 unregistered visitors
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 STRING at line 1 column 5

    at com.google.gson.stream.JsonReader.expect()
  2. Gson
    Gson.fromJson
    1. com.google.gson.stream.JsonReader.expect(JsonReader.java:339)
    2. com.google.gson.stream.JsonReader.beginObject(JsonReader.java:322)
    3. com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165)
    4. com.google.gson.Gson.fromJson(Gson.java:795)
    5. com.google.gson.Gson.fromJson(Gson.java:761)
    6. com.google.gson.Gson.fromJson(Gson.java:710)
    7. com.google.gson.Gson.fromJson(Gson.java:682)
    7 frames
  3. com.infy.service
    DSprojectClient.main
    1. com.infy.service.DSprojectClient.main(DSprojectClient.java:30)
    1 frame