if you use Kotlin Multiplatform with an Android module and Realm you most likely also use Robolectric. If you run some realm tests with Robolectric and some without, Realm throws the following error. It works with all tests running on Robolectric.
Stacktrace & log output
java.lang.ExceptionInInitializerError
at io.realm.kotlin.internal.interop.RealmInteropKt.INVALID_CLASS_KEY_delegate$lambda$0(RealmInterop.kt:43)
How frequently does the bug occur?
Always
Description
Hey,
if you use Kotlin Multiplatform with an Android module and Realm you most likely also use Robolectric. If you run some realm tests with Robolectric and some without, Realm throws the following error. It works with all tests running on Robolectric.
Stacktrace & log output
Can you reproduce the bug?
Always
Reproduction Steps
Here is an example project.
Version
2.3.0
What Atlas App Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
Linux Debian testing
Build environment
Android Studio version: 2024.1.2 Patch 2 Android Build Tools version: 8.6.1 Gradle version: 8.10.2