ohh maybe i misread > Coroutines 1.7.0 will be...
# multiplatform
p
ohh maybe i misread
Coroutines 1.7.0 will be released without
native-mt
companion and we are gradually stopping the support of
native-mt
during the course of
1.6.x
lifecycle. We still are ready to accept PRs or release versions with the new Kotlin if there is a need to, but new coroutine features won't get
native-mt
support.
🧵 1
c
Coroutines 1.6.0 works with the new memory model, if you’re willing to enable that despite it still being experimental. I think I had the same error until I enabled the new MM with
kotlin.native.binary.memoryModel=experimental
in
gradle.properties
https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md#switch-to-the-new-mm
p
after bumping to
mt
i'm running now into
Copy code
Uncaught Kotlin exception: kotlin.native.IncorrectDereferenceException: illegal attempt to access non-shared <object>@a090e8 from other thread
which may make sense as i removed the
freeze
let me try that out
thanks @Casey Brooks
yaaay! it worked thanks again @Casey Brooks 🙇‍♂️
🎉 1
do you know if it's mandatory to add coroutines-android as part of
androidMain
deps? that'd be unfortunate, thought that only coroutines core was needed
can i workaround this somehow? i mean not depending on dispatchers main? for context i'm running into the missing main dispatcher exception
c
I’m not really sure. I’d think it should run if you literally don’t have any other code (including dependencies) that need
Dispatchers.Main
, but that’s probably a bad idea. At some point, I’d think you’ll want to deliver results to the UI and not have to do
runOnUiThread { }
. And I’m willing to bet that all of the Androidx libs that depend on coroutines depend on the Android variant, so it’s probably going to be there anyway, whether you explicitly use
Dispatchers.Main
or not
p
yeah it's more convenient, it's a non-ui library tho, will think about using
runOnUiThread
, great point, thanks again!
it's funny because in all the examples i saw it wasn't added explicitly probably because other deps brought it implicitly
@Casey Brooks do you know when the new memory model is going to be stable? i mean in what version?