They have a Kotlin example up on their Github, it'...
# android
m
They have a Kotlin example up on their Github, it's kinda small but might help. https://github.com/realm/realm-java/tree/master/examples/kotlinExample
b
morganbovi: i had this error because i follow this sample step by step 😕 i had resolve the problem thank you
m
What was the fix?
i
You can just use a constructor with args which have default values
b
don’t use this syntaxe : (same in kotlin realm example) @RealmClass open class POJO( @PrimaryKey var id: Long ,var title: String ,var content:String ) : RealmObject() {} but use this : @RealmClass open class POJO : RealmObject() { @PrimaryKey var id: Long = 0 var title: String =“” var content: String =“” }
realm need default constructor to work 😕
k
@ben.slama.jihed Have you considered the no-arg compiler plugin? See https://kotlinlang.org/docs/reference/compiler-plugins.html#no-arg-compiler-plugin
b
no i will try that to day 😄
👍 1