1
致命的異常模式的不部分:主境界與科特林
java.lang.IllegalArgumentException:
student_relam_pojo is not part of the schema for this Realm at io.realm.internal.modules.CompositeMediator.getMediator(CompositeMediator.java:118) at io.realm.internal.modules.CompositeMediator.getTableName(CompositeMediator.java:71) at io.realm.Realm.getTable(Realm.java:327)
at io.realm.Realm.createObject(Realm.java:1085)at example.com.kotlinexamplebydimple.RealmActivity$onCreate$1.onClick(RealmActivity.kt:24)
VAL境界= Realm.getInstance(此@ RealmActivity)
btn_click.setOnClickListener {
realm.beginTransaction()
var pojo : student_relam_pojo ?
pojo = realm.createObject(student_relam_pojo::class.java)
pojo.nm = edt_name.text.toString()
pojo.pass = edt_pass.text.toString()
realm.commitTransaction()
}
Student_realm_pojo
public open class student_relam_pojo() : RealmObject()
{
public open var nm : String ?= null
public open var pass : String ?= null
}
我們需要知道以下事情:1.)領域版本2.)應用Gradle插件順序3.)是庫模塊或應用程序內的RealmObjects – EpicPandaForce