realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Cannot be cast to RealmProxyInterface #6943

Closed wishy-viewlift closed 4 years ago

wishy-viewlift commented 4 years ago

I am added kotlin support to my existing Android Java Project

build.gradle `apply plugin: 'com.android.application'

apply plugin: 'com.google.gms.google-services' apply plugin: 'jacoco' apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' apply plugin: 'realm-android' `

Kotlin version : 1.3.71 Realm Version. : 6.1.0

With kotlin I get the exception DownloadVideoRealm cannot be cast to io.realm.com_viewlift_models_data_appcms_downloads_DownloadVideoRealmRealmProxyInterface

Realm class `public class DownloadVideoRealm extends RealmObject {

@PrimaryKey
private String videoIdDB;
private String videoId;
private long videoId_DM;
private long videoThumbId_DM;
private long posterThumbId_DM;
private long subtitlesId_DM

}`

What is the issue here? On java it works fine but with kotlin it gives the error

cmelchior commented 4 years ago

That looks weird, but we need an example project that reproduces this in order to investigate. I assume you can reproduce this every time?

wishy-viewlift commented 4 years ago

downgrading realm to version 6.0.2 is working fine