当我添加将RealmObject扩展到我的项目的ChatInformation kotlin类时,无法建立项目,哪里出错?

时间:2017-09-08 09:51:58

标签: android realm kotlin realm-mobile-platform

这是我的ChatInformation kotlin课程:

open class ChatInformation(
    var Id: Int = 0,
    var TopicId: Int = 0,
    var CreateTime: String? = null,
    var StartTime: String? = null,
    var EndTime: String? = null,
    var StatusId: Int = 0,
    var Duration: String? = null,
    var TeacherId: String = "",
    var LearnerId: String = "",
    var SubjectName: String = "",
    var TopicTitle: String = "",
    var Class: Int = 0,
    var Learner: String = "",
    var Teacher: String = "",
    var TeacherReady: Boolean = false,
    var LearnerReady: Boolean = false
) : RealmObject()

如果我添加此类,我会收到以下错误:

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.Compilation failed; see the compiler error output for details.

如果看到compliler这个

Note: Processing class ChatLesson
Note: Processing class CustomMessage
Note: Processing class RequestListen
Note: Creating DefaultRealmModule
An exception has occurred in the compiler (1.8.0_152-release). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NullPointerException

长错误跟踪

如果我删除或评论ChatInformation类成功构建错误在哪里? 我曾尝试使用领域3.5.0和3.7.1版本

1 个答案:

答案 0 :(得分:1)

我的错误是:我有一个

  

var类:Int = 0

我的ChatInformation类中的

字段,如果删除此字段,则效果很好