I'm trying to use Realm-java library built from source, I have used the below JARs and AARs
- a jar file for the Realm Gradle plugin
- an aar file for the Realm library
- a jar file for the annotations
- a jar file for the annotations processor
I have added Realm-annotations-processor as below in dependencies
kapt project(':realm-annotations-processor-5.8.0')
When we do
val realm = Realm.getDefaultInstance()
try {
realm.executeTransaction { realmInstance ->
realmInstance.copyToRealm(user)// ClassCastException thrown
}
} finally {
realm.refreshAndClose()
}
The precise exception we have encountered is:
UserModel cannot be cast to io.realm.com_example_mobile_test_auth_model_UserModelRealmProxyInterface