-
Notifications
You must be signed in to change notification settings - Fork 566
Compilation failed: null with Kotlin 1.3.40 #3109
Comments
Please try compile with option
and tell us if it helps or not. |
I am not sure where to put that configuration. I get a message compilations is an unknown property (in gradle). Apart from this I was able to localize this issue: The following construction does compile/run on the JVM but gives a NullPointerException when compiling to native:
If I remove the dependency on the timeProvider in the initialization of the creationTime property, the code does compile. I can workaround this issue but should this scenario be supported (it was working in 1.3.21)? |
Looks like a bug in the serialization plugin. @sandwwraith will look at it. |
@jcraane seems you are trying to serialize the |
That is correct indeed. But serializing/deserializing works on the JVM in this case but the compilation phase to IOS/native code fails. This was working with kotlin 1.3.21. If I remove the @serializable, compilation to native code works (but than I cannot deserialize/serialize it from/to JSON of course). |
This is an issue of https://github.com/Kotlin/kotlinx.serialization compiler plugin, so would be better to move discussing the problem there. |
@homuroll I've tried to add
Hope this helps, otherwise I'll wait for the kotlinx.serialization fix. |
I can confirm that the problem is caused by |
@sandwwraith can anything else cause this? We have a lot of classes too, but I don't think there is a single case where child class would not be marked as @serializable (all the classes top-down are serializable in our case). |
I know it's been a couple years, but I'm seeing the same issue https://youtrack.jetbrains.com/issue/KTOR-2174 |
We are migrating issue tracking to YouTrack, so I'm closing this issue in favour of KT-45044. |
We migrated our Kotlin multiplatform project from 1.3.21 to 1.3.40 (and updated all dependencies accordingly) and now we get the following error when compiling the common Kotlin code to IOS native:
There are lots of classes in our common code so it is not easy to determine what causes the error. Adding --info or --debug does not provide much more info.
Is there a preferred way of debugging these kind of issues? I can copy the code to a minimal project and then manually removing classes to see when it will work but this is quite tedious.
Thanks!
The text was updated successfully, but these errors were encountered: