我正在尝试将Realm包含到我现有的android proyect中。我正在使用DataBinding。在包含ORM依赖项后,我得到了:
错误:(29,30)错误:找不到符号类BR
与
相同错误:(31,42)错误:包com。*。数据绑定不存在
错误:任务':app:compileStagingDebugJavaWithJavac'的执行失败。 编译失败;有关详细信息,请参阅编译器错误输出。
我正按照文档here
中的说明使用 android {
....
dataBinding {
enabled = true
}
}
[编辑]这是完整的错误日志:LINK
构建失败后,我可以在文件夹/ app / build / generated / source / apt / staging / debug中看到已经生成的那些对象。
有什么建议吗?谢谢!
答案 0 :(得分:2)
正如日志所说:
注意:处理类AudioFileDownloaded 错误:如果声明了自定义构造函数,则必须声明没有参数的默认公共构造函数。
如果您有自定义构造,则需要为AudioFileDownloaded
定义一个空的默认构造函数。
见https://realm.io/docs/java/latest/#limitations
答案 1 :(得分:0)
what is the error output? please post your logs
Edit after logs posted: I think your problem is here, seems like you have an error: Note: Processing class AudioFileDownloaded Error:A default public constructor with no argument must be declared if a custom constructor is declared.