Hi all! I am using `kotlinx-datetime` for KMM deve...
# kotlinx-datetime
z
Hi all! I am using
kotlinx-datetime
for KMM development. In my
androidApp/build.gradle.kts
, if I set
debuggable
to
true
, then it works well. But if I set
debuggable
to
false
(for release), the app will crash immediately when executing any
kotlinx-datetime
code (in common folder). Does anyone know the reason?
1
l
What's the crash?
z
I log the error through Crashlytics. The devices is running Android 11, It only happens when the
isDebuggable
option is set to false. It feels like the option somehow broke the
coreLibraryDesugaring
but I am not sure.
l
You need to configure the desugaring in every module you are using kotlinx.datetime and java.time APIs.
z
Thank you! I figured out that I only added
kotlinx.datetime
dependency into the common module. I fixed the issue by adding it into
androidApp/build.gradle.kts
although it is not used in androidApp. And the interesting fact is that the issue only happens when
debuggable=false
.