https://kotlinlang.org logo
Title
p

plastiv

06/02/2021, 4:21 PM
One of the 3rd party sdk bundles transitive
kotlinx-coroutines-android:1.4.3-native-mt
dependency. Can’t find information what does it mean? I need to force
-native-mt
variant across my app? Or because I build android application I can safely resolve to normal
1.4.3
variant?
The issue is that gradle ups version by default and artifact change isn’t visible
+--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3-native-mt -> 1.5.0 (*)
l

louiscad

06/02/2021, 6:08 PM
You can search for "1.5.0" and you'll see what is upgrading it. Native mt is needed if you want withContext and other Darwin (iOS, macOS, etc) stuff like Dispatchers.Main to work. If you're doing JVM or JS, you don't need it.
p

plastiv

06/02/2021, 6:18 PM
Thank you for taking time to answer! So can I say that android sdk (library) which exposes
-native-mt
artifact is a mistake (leaking impl detail)?
l

louiscad

06/02/2021, 6:21 PM
Not really, because it doesn't affect you in any way on Android.
🙏 1
The behavior changes are only on Kotlin/Native.
I guess this SDK/library also supports iOS
p

plastiv

06/02/2021, 7:12 PM
They do. I’m not up-to-date with MPP development. But likely iOS builds don’t consume .aar artifact through maven repo. Maybe it’s a purist in me. I just find confusing
-native-mt
dep exposed to android variant. I would assume it’s a dependency for core (common) kotlin code but not to final android variant. Anyway, the sdk works as far as I see so no real issue here. Thank you for confirmation
l

louiscad

06/02/2021, 8:49 PM
iOS builds consume klib artifacts from the same repo most likely, and it's published as part of the same distributed build, so same versions so common code doesn't break.