When I add "io.ktor:ktor-serialization-kotlinx-xml...
# multiplatform
d
When I add "io.ktor:ktor-serialization-kotlinx-xml" to my libs.version.toml file and sync I get Could not resolve io.ktorktor serialization kotinx xml2.3.12" for "sharedio[all ios platforms]" I'm stumped on what I'm doing wrong here. I have a similar dependency on ktor's JSON serialization and that doesn't have the above error with iOS. 😕
🧵 2
m
You’re missing a ‘l’ in
kotinx-xml
The artifact is available here
d
I think that typo was just from me copying the error message into Slack. I made sure I had the right name:
Copy code
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
ktor-serialization-kotlinx-xml = { module = "io.ktor:ktor-serialization-kotlinx-xml", version.ref = "ktor" }
and added the dependency to commonMain but I'm still getting the error with iOS:
👍 1
Is there something special that has to be done to make XML serialization available to iOS devices? Seems odd they'd need native code for that.
I tried adding io.ktor:ktor-client-serialization-ios as a dependency for iosMain but that doesn't seem to provide whatever it needs. 😕
m
Mmmm, right, looking at the .module file it doesn’t look like it’s available on iOS
If it were, you would see the variants there
Ah, there’s no first party XML support in kotlinx-serialization: https://github.com/Kotlin/kotlinx.serialization/issues/188
I wonder what ktor is using 🤔
Which looks like it’s supporting iOS (but ktor-serialization-kotlinx-xml is not)
You can try using https://github.com/pdvrieze/xmlutil directly
👍 1
d
@mbonnin kk - ty, I'll give it a try.