-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.0.0-RC2 on iOS: Deserializer for declaration public kotlinx.serialization.json/Json|null[0] is not found #1110
Comments
I'm having the same issue. Did you find a solution? |
No. We've rolled back to 1.0.0-RC waiting for a fix |
Got the same error with 1.0.0-RC2. For Android works just fine
|
I ran into the same issue. I was able to easily repro via the iosTest task, which made it easier to try different things to get it working. Changing coroutines to 1.3.9-native-mt or 1.3.9-native-mt-2 did nothing to change it. But I happen to also use Ktor in my shared library, and when I bumped that to the latest 1.4.1 version, the error above goes away and I can build and run successfully. So I suspect that Ktor 1.4.1 us pulling in some other newer dependency that makes things work, though I am unsure how to prove this. But if you are using Ktor, this may be a simpler fix. If not, perhaps simply including the dependency for it will make things work for you. |
Can someone provide a small project with reproducer? From what @tylerwilson said, I suspect that this caused by different transitive dependencies versions — if you have ktor that uses 1.0.0-RC, and trying to use RC2 in your project manually, this error happens. @SalomonBrys Ktor 1.4.1 uses serialization RC2. Can you upgrade your Ktor versions and check if the problem is resolved? |
Updating ktor to version 1.4.1 fixed the issue. |
After updating project to kotlin 1.4.10 I was still using dependency "kotlinx-serialization-core". With ktor 1.4.1 this gives next error for native framework build: It's because ktor 1.4.1 transparently adds "kotlinx-serialization-json:1.0.0-RC2" dependency, but ktor 1.4.0 does not, which gives me compilation error even for android build. After explicitly adding/replacing serialization dependency with "kotlinx-serialization-json:1.0.0" all works fine. I think error messages should be more clear, and many of transitive dependecies makes dependency hell. |
In case it helps anyone, this did the trick for me: https://youtrack.jetbrains.com/issue/KT-41378#focus=Comments-27-4457544.0-0. I was having a similar issue but with coroutines, so while it is not directly related it can still help. Basically you need to force the kotlinx-coroutines-core version to 1.3.9-native-mt-2 using this Gradle syntax:
|
This has worked for me. Thanks a lot! and with the following versions for ktor, coroutines and serialization versions: ... |
We have an app that compiles fine for iOS using Kotlin 1.4.10 with Serialization core
1.0.0-RC
.When I update Serialization core to
1.0.0-RC2
and add the json dependency, it compiles & run fine on the JVM, but fails on Kotlin/Native for iOS with the following compilation exception:The text was updated successfully, but these errors were encountered: