https://kotlinlang.org logo
#ktor
Title
# ktor
m

mboudraa

05/28/2021, 5:49 PM
Hi folks, I migrated to kotlin 1.5.0 and ktor 1.6.0. I’m using the
native-mt
version of coroutines 1.5.0. I have a very simple test that fails on iOS with a
kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.collections.HashMap@1657db08
and I have no idea where it can come from given the simplicity of this test. If anyone has any lead, it would be very helpful
youtrack 1
Here is the full stacktrace if it helps
FYI The same test pass if my data class contains all the keys the json contains
t

turansky

05/28/2021, 8:47 PM
Do you update
serialization
?
Do you use latest configuration? Kotlin
1.5.10
Coroutines
1.5.0
Serialization
1.2.1
Ktor
1.6.0
m

mboudraa

05/28/2021, 9:11 PM
Yes. I just double checked. And it produces the same error
r

Robin Hos

05/29/2021, 10:07 AM
I had the same issue this morning. 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.
👍 1
h

Henry

07/04/2021, 6:51 AM
I set
useAlternativeNames = false
, it’s work
do exact @Robin Hos said
p

ptsiogas

07/07/2021, 1:09 PM
The workaround works fine, should we expect a new Ktor version that won’t require the workaround?