com.google.gson.JsonSyntaxException

com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 30 path $[0].question[1]

Samebug tips2

Your json input might be invalid. Try checking it in a validator like https://jsonlint.com

Your custom gson deserializer might have a bug. Try to write a unit test that checks proper deserialization of only that class by forging a json that contains a single field of that type.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web758

  • com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 30 path $[0].question[1]
  • com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 5882431 path $.diffs[132].fileComments[1]
  • via GitHub by robertotru
    , 8 months ago
    com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 26 path $.message
  • Stack trace

    • com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 30 path $[0].question[1] at com.google.gson.Gson.fromJson(Gson.java:902) at com.google.gson.Gson.fromJson(Gson.java:852) at com.google.gson.Gson.fromJson(Gson.java:801) at svmc.anthao.MainActivity$1.onPostExecute(MainActivity.java:49) at svmc.anthao.MainActivity$1.onPostExecute(MainActivity.java:36) at android.os.AsyncTask.finish(AsyncTask.java:632) at android.os.AsyncTask.access$600(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5268) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) at dalvik.system.NativeStart.main(Native Method)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Once, 3 weeks ago
    Once, 2 months ago
    Unknown user
    Once, 6 months ago
    4 times, 7 months ago
    5 times, 8 months ago
    14 more bugmates