realm-kotlin icon indicating copy to clipboard operation
realm-kotlin copied to clipboard

Mixing Robolectric tests with normal tests throws Error on Android with Kotlin multiplatform

Open Burtan opened this issue 1 year ago • 1 comments

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

java.lang.ExceptionInInitializerError
	at io.realm.kotlin.internal.interop.RealmInteropKt.INVALID_CLASS_KEY_delegate$lambda$0(RealmInterop.kt:43)

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

Burtan avatar Sep 28 '24 08:09 Burtan