java.lang.ClassCastException: com.example.RealmInteger cannot be cast to io.realm.internal.RealmObjectProxy

GitHub | AlexLardschneider | 9 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

    ClassCastException when trying to convert a field from int to integer list

    GitHub | 9 months ago | AlexLardschneider
    java.lang.ClassCastException: com.example.RealmInteger cannot be cast to io.realm.internal.RealmObjectProxy

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.example.RealmInteger cannot be cast to io.realm.internal.RealmObjectProxy

      at io.realm.DynamicRealmObject.setList()
    2. io.realm
      DynamicRealmObject.setList
      1. io.realm.DynamicRealmObject.setList(DynamicRealmObject.java:602)
      1 frame
    3. com.example
      RealmHelper$Migration$1.apply
      1. com.example.RealmHelper$Migration$1.apply(RealmHelper.java:132)
      1 frame
    4. io.realm
      RealmObjectSchema.transform
      1. io.realm.RealmObjectSchema.transform(RealmObjectSchema.java:475)
      1 frame
    5. com.example
      RealmHelper$Migration.migrate
      1. com.example.RealmHelper$Migration.migrate(RealmHelper.java:126)
      1 frame
    6. io.realm
      Realm.getDefaultInstance
      1. io.realm.BaseRealm$3.onResult(BaseRealm.java:705)
      2. io.realm.RealmCache.invokeWithGlobalRefCount(RealmCache.java:267)
      3. io.realm.BaseRealm.migrateRealm(BaseRealm.java:685)
      4. io.realm.Realm.migrateRealm(Realm.java:1221)
      5. io.realm.Realm.migrateRealm(Realm.java:1208)
      6. io.realm.Realm.createInstance(Realm.java:235)
      7. io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:126)
      8. io.realm.Realm.getDefaultInstance(Realm.java:174)
      8 frames
    7. com.example
      AppApplication.onCreate
      1. com.example.RealmHelper.init(RealmHelper.java:86)
      2. com.example.AppApplication.onCreate(AppApplication.java:95)
      2 frames
    8. Android Platform
      ActivityThread.handleBindApplication
      1. android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014)
      2. android.app.ActivityThread.handleBindApplication(ActivityThread.java:4751)
      2 frames