Up until recently, when my ios app crashed with so...
# kotlin-native
m
Up until recently, when my ios app crashed with some InvalidMutabilityException, I could read the kotlin error from the xcode console. Right now it doesn't say anything more than
Function doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError.
And the stacktrace is obviously rubbish. I cannot pinpoint when it exactly changed, any ideas what might be causing it?
c
Its stating exactly what it says. Add the
@Throws
m
Usually ot said much more, that's the problem. It said where it happened for example. So I know where to add Throws
Now there's only this
Don't even know what exception it threw to put it in annotation
k
In general I would not add @Throws. We rarely use it. It's curious that you get that error but Xcode doesn't tell you anything useful about it. I don't know that anything has changed in the K/N runtime, though. Worst case, you could add a default exception handler to print out the actual exception. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native/set-unhandled-exception-hook.html
m
This looks useful, thanks! I started wondering if maybe it stopped appearing after I added crashlytics. It might override the default crash handler and mute the console errors. Just a working theory though
k
Seems plausible
How did you add Crashlytics? Some default handler examples here actually https://github.com/touchlab/CrashKiOS
m
I did add your lib as well on top of regular crashlytics, but haven't tested it thoroughly in this new project yet. I also have some issues with dsyms for whatever reason. It worked on a some sample project I did on kmm, but there are so many moving parts around reporting issues in kotlin native ios that I felt like I started all over again with the new project :D