com.squareup.moshi.JsonDataException

java.lang.NullPointerException at $[0]

Solutions on the web10

  • via Stack Overflow by jean d'arme
    , 9 months ago
    java.lang.NullPointerException at $[0]
  • via GitHub by cesarnorena
    , 3 months ago
    Expected one of [0, 1] but was 0 at path $.value
  • via GitHub by dvinz
    , 3 months ago
    Expected a long but was NULL at path $.items[0].updatedDate
  • Stack trace

    • com.squareup.moshi.JsonDataException: java.lang.NullPointerException at $[0] at com.squareup.moshi.AdapterMethodsFactory$1.toJson(AdapterMethodsFactory.java:68) at com.squareup.moshi.CollectionJsonAdapter.toJson(CollectionJsonAdapter.java:84) at com.squareup.moshi.CollectionJsonAdapter$2.toJson(CollectionJsonAdapter.java:52) at com.squareup.moshi.JsonAdapter$1.toJson(JsonAdapter.java:75) at com.squareup.moshi.JsonAdapter.toJson(JsonAdapter.java:44) at com.squareup.moshi.JsonAdapter.toJson(JsonAdapter.java:50) at package.network.DatabaseSyncHelper.sendContacts(DatabaseSyncHelper.java:203) at package.network.DatabaseSyncHelper.lambda$getCallLogs$2(DatabaseSyncHelper.java:167) at package.network.DatabaseSyncHelper.access$lambda$2(DatabaseSyncHelper.java:0) at package.network.DatabaseSyncHelper$$Lambda$5.call(Unknown Source) at rx.internal.util.ActionSubscriber.onNext(ActionSubscriber.java:39) at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:139) at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:227) at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:107) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5602) 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:1283) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) 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

    You are the first who have seen this exception. Write a tip to help other users and build your expert profile.