I am using a Kotlin data class with Realm, Gson annotation for fetching Data from server.
Problem: When i run project in android studio it gives following error
Error:Class "VenderConfig" contains illegal final field "name".
I am learning Kotlin so don't have much idea about that.
My VenderConfig class is:
@RealmClass
class VenderConfig(
@SerializedName("name")
val name: String? = null,
@SerializedName("website")
val wb_url: String? = null,
@SerializedName("icon")
val icon: String? = null,
@SerializedName("logo")
val logo: String? = null,
@SerializedName("description")
val description: String? = null,
@PrimaryKey
@SerializedName("id")
val id: Int? = null
) : RealmObject() {
}
I have also tried open keyword with the field and remove data keyword also, but it did not solve the issue.