io.realm.exceptions.RealmException: 'RealmNoticeModelClass' has a primary key, use 'createObject(Class<E>, Object)' instead.

Stack Overflow | Sahaj Rana | 5 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

    'RealmNoticeModelClass' has a primary key, use 'createObject(Class<E>, Object)' instead

    Stack Overflow | 5 months ago | Sahaj Rana
    io.realm.exceptions.RealmException: 'RealmNoticeModelClass' has a primary key, use 'createObject(Class<E>, Object)' instead.
  2. 0

    'User' has a primary key, use 'createObject(Class<E>, Object)' instead

    Stack Overflow | 4 months ago | Theo
    io.realm.exceptions.RealmException: 'User' has a primary key, use 'createObject(Class<E>, Object)' instead.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

Root Cause Analysis

  1. io.realm.exceptions.RealmException

    'RealmNoticeModelClass' has a primary key, use 'createObject(Class<E>, Object)' instead.

    at io.realm.Realm.createObjectInternal()
  2. io.realm
    Realm.createObject
    1. io.realm.Realm.createObjectInternal(Realm.java:821)
    2. io.realm.Realm.createObject(Realm.java:802)
    2 frames
  3. com.rana.sahaj
    NoticeOnItemSelectedActivity$1$2.onSuccess
    1. com.rana.sahaj.myyu.notice.NoticeOnItemSelectedActivity$1$2.onSuccess(NoticeOnItemSelectedActivity.java:162)
    2. com.rana.sahaj.myyu.notice.NoticeOnItemSelectedActivity$1$2.onSuccess(NoticeOnItemSelectedActivity.java:156)
    2 frames
  4. com.google.android
    zze$1.run
    1. com.google.android.gms.tasks.zze$1.run(Unknown Source)
    1 frame
  5. Android Platform
    ActivityThread.main
    1. android.os.Handler.handleCallback(Handler.java:733)
    2. android.os.Handler.dispatchMessage(Handler.java:95)
    3. android.os.Looper.loop(Looper.java:136)
    4. android.app.ActivityThread.main(ActivityThread.java:5052)
    4 frames
  6. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invokeNative(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:515)
    2 frames
  7. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
    2 frames
  8. Android Platform
    NativeStart.main
    1. dalvik.system.NativeStart.main(Native Method)
    1 frame