提交到Realm时如何修复错误

时间:2018-11-30 21:18:39

标签: java android realm

我正在开发使用Realm作为数据库的android应用程序,但是在Relm中执行commitTransiction()方法时出现错误 这是导致崩溃的方法

if (food!= null) {
    foodDb.beginTransaction();
    food.setChatName(group.getName());
    food.setChatImage(group.getImage());
    food.setChatStatus(group.getStatus());
    foodDb.commitTransaction();
        }

这是我收到的logcat错误:

11-30 23:15:06.486 4480-4480/com.yourapp.chatapp E/REALM_JNI: jni: ThrowingException 2, Out of range  in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsList.cpp line 135(requested: 4294967295 valid: 0), .
Exception has been thrown: Out of range  in /Users/cm/Realm/realm- 
    java/realm/realm-library/src/main/cpp/io_realm_internal_OsList.cpp line 
    135(requested: 4294967295 valid: 0)
     11-30 23:15:06.496 4480-4480/com.yourapp.chatapp E/dalvikvm: VM aborting
 11-30 23:15:06.496 4480-4480/com.yourapp.chatapp A/libc: Fatal signal 6 
   (SIGABRT) at 0x00001180 (code=-6), thread 4480 (yourapp.chatapp)

0 个答案:

没有答案