When I call the realm.where(MessageEventModel::class.java).findAll()
it throws excepiton: this is error
java.lang.IllegalArgumentExcept
The issue where in gradle file.The problem where just an ordering rules of applying plugins, thanks to the @EpicPandaForce's comment, the problem has been solved, I'm writing answer, for helping others, if they miss the commented answer from @EpicPandaForce
I changed the ordering of
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
to
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'
That's all, now everything works fine