com.google.gson.JsonSyntaxException

java.lang.IllegalStateException: Expected an int but was BOOLEAN at line 1 column 201 path $[0].createTime

Samebug tips2

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


poroszdporoszd

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.


poroszdporoszd

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

Solutions on the web169

  • via Unknown by Unknown author,
  • Stack trace

    • com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected an int but was BOOLEAN at line 1 column 201 path $[0].createTime at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:200) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60) at com.google.gson.Gson.fromJson(Gson.java:810) at com.google.gson.Gson.fromJson(Gson.java:775) at com.google.gson.Gson.fromJson(Gson.java:724) at com.tencent.qcloud.suixinbo.presenters.OKhttpHelper.getLiveList(OKhttpHelper.java:183) at com.tencent.qcloud.suixinbo.presenters.LiveListViewHelper$GetLiveListTask.doInBackground(LiveListViewHelper.java:43) at com.tencent.qcloud.suixinbo.presenters.LiveListViewHelper$GetLiveListTask.doInBackground(LiveListViewHelper.java:39) at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)

    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

    Atique AhemadAtique Ahemad
    Once,
    Hiren AmaliyarHiren Amaliyar
    Once,
    Unknown visitor
    Unknown visitorOnce,
    linxiaolonglinxiaolong
    4 times, last one
    Alexandru PopaAlexandru Popa
    5 times, last one
    23 more bugmates