Solution 1 :
After upgrading to Kotlin 1.7.0 and using kotlinx-datetime 0.3.2, I started to face the same issue.
As suggested here, upgrading to org.jetbrains.kotlinx:kotlinx-datetime:0.3.3
solved the issue.
Problem :
I was able to successfully run the sample app generated by Android Studio in both Android and iOS. I chose CocoaPods during the Wizard steps.
But when I add kotlinx-datetime to my dependencies, I can only run the app for Android.
My build.gradle.kts :
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.0")
}
}
...
When adding the library I get the following error:
> Task :shared:linkDebugFrameworkIosX64 FAILED
e: Compilation failed: Expecting descriptor for kotlin.time/TimeMark.<init>|-5645683436151566731[0]
* Source files:
* Compiler version info: Konan: 1.7.0 / Kotlin: 1.7.20
* Output kind: STATIC_CACHE
e: java.lang.IllegalStateException: Expecting descriptor for kotlin.time/TimeMark.<init>|-5645683436151566731[0]
How to reproduce:
- Create a KMM sample app with AS.
- Add the library : implementation(“org.jetbrains.kotlinx:kotlinx-datetime:0.3.0”) to the commonMain in the build.gradle.kts
- Try to use/import/print LocalDate in any way
Any ideas how to solve this?