У меня есть один открытый класс, подобный этому
open class NewsResponse(
@field:SerializedName("news")
val news: List<NewsItem?>? = null
):RealmObject()
И класс NewsItem, подобный этому
open class NewsItem(
@field:SerializedName("created")
val created: String? = null,
@field:SerializedName("link")
val link: String? = null,
@field:SerializedName("description")
val description: String? = null,
@field:SerializedName("title")
val title: String? = null
):RealmObject()
Я также добавил
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android-extensions'
эти плагины в приложенииgradle
У меня classpath "io.realm:realm-gradle-plugin:5.1.0"
на уровне проекта.Поэтому, когда я запускаю приложение, я получаю сообщение об ошибке
Caused by: io.realm.exceptions.RealmException: NewsItem is not part of the schema for this Realm
at io.realm.internal.modules.CompositeMediator.getMediator(CompositeMediator.java:180)
Как решить эту проблему?