java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map

Stack Overflow | bojan | 4 days ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to Rafael Fischer Viola and rafael . Or join the community to write better ones.
  1. 0

    HashMap cannot be cast to ArrayList

    Stack Overflow | 4 days ago | bojan
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map
  2. 0
    samebug tip
    Firebase Database considers public fields and JavaBean-like getters and setters when serializing/deserializing JSON. A public field with a getter and a setter may cause this exception. Try to change to private or removing getter and setter.
  3. 0
    samebug tip
    Update Google Play Services to the latest version and android support library to latest version. 9.8 for google play services and 25.0.0 for the android support libraries seems to make it work.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    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.ClassCastException

      java.util.ArrayList cannot be cast to java.util.Map

      at com.packtpub.materialdesign4.TileContentFragment$1$1.onDataChange()
    2. com.packtpub.materialdesign4
      TileContentFragment$1$1.onDataChange
      1. com.packtpub.materialdesign4.TileContentFragment$1$1.onDataChange(TileContentFragment.java:82)
      1 frame
    3. com.google.android
      zzalj$1.run
      1. com.google.android.gms.internal.zzakg.zza(Unknown Source)
      2. com.google.android.gms.internal.zzalg.zzcxk(Unknown Source)
      3. com.google.android.gms.internal.zzalj$1.run(Unknown Source)
      3 frames
    4. Android Platform
      ActivityThread.main
      1. android.os.Handler.handleCallback(Handler.java:739)
      2. android.os.Handler.dispatchMessage(Handler.java:95)
      3. android.os.Looper.loop(Looper.java:148)
      4. android.app.ActivityThread.main(ActivityThread.java:5527)
      4 frames
    5. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      1 frame
    6. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
      2 frames