Issue
In Java SDK, I was creating Realm.Configuration object with the realm file that located in asset folder. I couldn't find any equivalent property in Realm Kotlin SDK
in java SDK:
val populatedRealmConfiguration = RealmConfiguration.Builder()
.schemaVersion(REALM_VERSION)
.compactOnLaunch()
.encryptionKey(resolveEncrypt(RealmHelperStatics.EncRealmKey).toByteArray())
.assetFile("populated.realm")
.name("populated.realm")
.allowQueriesOnUiThread(true)
.allowWritesOnUiThread(true)
.build()
I have followed the migration guide: https://www.mongodb.com/docs/realm/sdk/kotlin/migrate-from-java-sdk-to-kotlin-sdk/
How to use ".assetFile" property in Kotlin SDK ?
Solution
In Kotlin SDK, assetFile feature isn't available. See : https://github.com/realm/realm-kotlin/issues/927
Answered By - Eren Enc
Answer Checked By - David Marino (JavaFixing Volunteer)