https://kotlinlang.org logo
e

elye

06/14/2021, 11:40 AM
While trying with KMM Tutorial

https://www.youtube.com/watch?v=_Q62iJoNOfg

, but with slightly different model… I got the below error when performing deserialization for iOS (okay in Android though). https://stackoverflow.com/questions/67969562/kotlin-native-concurrent-invalidmutabilityexception-mutation-attempt-of-frozen Any idea what cause the problem? Or is the a Kotlin-Native bug?
b

bsimmons

06/14/2021, 11:50 AM
What version of coroutines are you using? Try using
-native-mt
and launch your ktor request on
Dispatchers.Main
r

Robin Hos

06/15/2021, 8:55 AM
I had the same issue a while ago after the launch of ktor 1.6.0, this probably the same. It is already tracked, (see https://github.com/Kotlin/kotlinx.serialization/issues/1450) and fixed (see https://github.com/Kotlin/kotlinx.serialization/pull/1484), but it isn’t released yet. For me the given workaround to set
useAlternativeNames = false
worked.
e

elye

06/18/2021, 3:24 PM
Thanks @bsimmons @Robin Hos. I found the workaround for it https://stackoverflow.com/a/67969770/3286489.
👍 1
r

Robin Hos

06/19/2021, 4:11 PM
That is exactly the workaround I described above
🙏 1