Closed ypujante closed 3 years ago
Interestingly, it fails with code like that, if Compose plugin is applied:
@ExperimentalTime
fun main() {
runBlocking {
launch {
repeat(1000) { i ->
println("job: I'm sleeping $i ...")
delay(Duration.seconds(1))
}
}
}
}```
Seems depends on version of kotlinx-coroutines-core
. Fails with 1.4.x, and works with 1.5.0. And Compose uses 1.4.3.
https://android-review.googlesource.com/c/platform/frameworks/support/+/1717755 promotes Compose to 1.5.0.
@ypujante please try
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
implementation(compose.desktop.currentOs)
}
in your build.gradle.kts
.
I confirm that it works with this change. Another workaround is to do Duration.seconds(1).inWholeMilliseconds
which does not introduce a dependency on a different version of couroutines.
Seems it is fixed. Reopen if not.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
After upgrading to M4 / 0.4.0 (from M3 0.3.0), the following code fails:
with the following error
Note that it works with
delay(1000)