https://kotlinlang.org logo
#realm
Title
# realm
b

BaBeStudios

11/08/2023, 12:07 PM
Calling RealmInstant.now() in Android 7 (API 25) and below will fail with the following exception:
Copy code
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.time.Clock" on path: DexPathList[[zip file "/data/app/[...]split_config.xxxhdpi.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
    dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    java.lang.ClassLoader.loadClass(ClassLoader.java:380)
    java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    io.realm.kotlin.internal.platform.SystemUtilsKt.currentTime(SystemUtils.kt:32)
    io.realm.kotlin.types.RealmInstant$Companion.now(RealmInstant.kt:87)
Clock was added in API 26 for Android. Is there a way to mitigate this, or is the minimum Android SDK version for the Kotlin SDK effectively API level 26? I'm writing this before looking into replacing RealmInstant or the call to systemUTC(), that causes the Exception.
b

BaBeStudios

11/08/2023, 2:08 PM
Thanks, I appreciate that. Sure, I couldn't find that information quickly, and I thought it was a quicker way to ask this time.
6 Views