https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

saket

07/06/2021, 6:09 AM
I’m banging my head over this for the past couple hours. Has anyone else run into this error while trying to build any native target?
Copy code
> Task :common:linkDebugTestMacOS FAILED
e: Compilation failed: Deserializer for declaration public kotlinx.coroutines/cancel|8411479413341223858[0] is not found

 * Source files:
 * Compiler version info: Konan: 1.5.10 / Kotlin: 1.5.10
 * Output kind: STATIC_CACHE

e: java.lang.IllegalStateException: Deserializer for declaration public kotlinx.coroutines/cancel|8411479413341223858[0] is not found
I’m already forcing all transitive dependencies of coroutines to
1.5.0-native-mt
by using:
Copy code
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-native-mt") {
  version { strictly("1.5.0-native-mt) }
}
g

gildor

07/06/2021, 6:11 AM
It looks that you are trying to serialize some lambda
r

rnett

07/06/2021, 6:27 AM
That looks like an internal compiler issue (IR deserialization failing, not kotlinx.serialization), your best bet is probably a youtrack issue.
r

russhwolf

07/06/2021, 2:57 PM
Maybe a version mismatch in your dependencies? Do you have any libraries that were built with 1.5.20?
s

saket

07/06/2021, 6:44 PM
@rnett yep, I’ll file one. @russhwolf ooh that could be true. Let me go through my dependencies.
That was it! Turns out this was happening because I was using an older version of reaktive that was compiled against kotlin 1.4.30. I did not suspect this at all because I’ve seen the k/n compiler explicitly complain about libraries compiled with older versions of kotlin in the past. Thanks for the hint @russhwolf!
r

russhwolf

07/06/2021, 7:13 PM
interesting. I actually would have thought that would be compatible. Most of 1.4.3x libs work with 1.5.x as long as they don't hit experimental API like
Duration
a

Arkadii Ivanov

07/06/2021, 11:33 PM