Hi there. I'm guessing I can't just `java.util.Dat...
# multiplatform
a
Hi there. I'm guessing I can't just
java.util.Date
in the
shared
module under
commonMain
? (I'm guessing this because the import fails, although I have other strange import failures)
Actually, I have a bigger problem I think. I can't import anything from the
kotlinx
package yet I seem to be importing the dependencies: My
build.gradle
file is
Copy code
plugins {
    id 'java-library'
    id "org.jetbrains.kotlin.multiplatform"
}

kotlin {
    jvm()
    iosX64()
    iosArm32()
    iosArm64()
}

sourceSets {
    commonMain {
        dependencies {
            implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
            implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.3.2"
        }
    }
}
m
Should solve your dependencies issue.
Copy code
// build.gradle.kts
kotlin {
    jvm()
    iosX64()
    // ... more targets

    val commonMain by getting {
        // ...
    }
}
Regarding the date time stuff, checkout: https://github.com/Kotlin/kotlinx-datetime Also another great resource for finding KMP libraries is: https://github.com/AAkira/Kotlin-Multiplatform-Libraries
a
It's a groovy gradle file not a kotlin one, so the above syntax doesn't work sadly
It's not so much about the library. It's importing them correctly
m
oh, looks like you need to remove the
java-library
plugin
🙌 1
a
Yeah. I think you're right. I'm having new problems now thought 🙂