1

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:

  1. Create a KMM sample app with AS.
  2. Add the library : implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.0") to the commonMain in the build.gradle.kts
  3. Try to use/import/print LocalDate in any way

Any ideas how to solve this?

Renaro Santos
  • 403
  • 1
  • 7
  • 19

1 Answers1

5

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.

Burak
  • 478
  • 1
  • 6
  • 18