【问题标题】:Can not gradle build project when i add ChatInformation kotlin class that extends RealmObject to my project, where is error?当我将扩展 RealmObject 的 ChatInformation kotlin 类添加到我的项目时,无法构建项目,错误在哪里?
【发布时间】:2017-09-08 09:51:58
【问题描述】:

这是我的 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.

如果看到编译器这个

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 版本中都尝试过

【问题讨论】:

    标签: android realm kotlin realm-mobile-platform


    【解决方案1】:

    我的错误是:我有一个

    var 类:Int = 0

    我的 ChatInformation 类中的字段,如果删除此字段效果很好

    【讨论】:

      猜你喜欢
      • 2018-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多