They have a Kotlin example up on their Github, it's kinda small but might help. <https://github.com/...
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