Hello Kotlin community, Please help me understand...
# multiplatform
i
Hello Kotlin community, Please help me understand how to deal with issues such as
fatal crashes
in an
iOS
application with the
KMP+Compose
stack, and share your experience/advice or solution on how you handle the same cases. I have an iOS application that fully uses shared logic and UI, and I see that our
Firebase iOS Crashlytics
and `Apple crash systems`(Xcode -> Windows - Organizer -> App -> Crashed) haven't a lot of information about crashes. During the testing, I see that if a crash is sent manually from the Kotlin side from any place, it's not visible in the Crashlytics dashboard. If sent from the native side, all is fine. Also, I have one additional case: One of our versions of the app has some random crashes that we can't detect, but our testing team, using the TestFlight build, can reproduce it with a few devices, and always when they press Share report, it's a system window, info from all devices is not presented anywhere. The systems, such as Firebase and the App Crash, show some errors, but I believe and can prove that we missed a thousand crashes, and don't know about them. After research, I started to think it's a tradeoff of these technologies, and it's not possible to handle.
y
any specific crash logs or minimal reproduction steps?
i
No, just a crash that starts when we moved from
1.10.1
to
1.11.0
, and I can’t detect it by debugging and TestFlight if it happens, and I share it to RestFlight. I'm not sure if it's related to the migration of the version
y
even if it is an sdk regression, unfortunately it's really hard to tell for sure without a specific crash log, stack trace, or a minimal reproduction repo.
🤝 1
➕ 1
i
I am just wondering if it's a normal case that a lot of crashes are not tracked with this stack of technologies( KMP/Compose + iOS ). I researched different info about the system, such as Crashlytics, how they work, and so like..., and started thinking that the pain of tracking is just a tradeoff for technologies if I use it. Am I right with my assumption?
y
yes, aside from Apple's built-in crash reporting tools, people have a much better chance at getting insights from an in-house solution, or a ready-made one like Sentry or Crashlytics, depending on your use case. if your question is about tracking and the legal/ethical implications of it, then yes, it is a tradeoff many teams are willing to accept at a certain point once gaining enough traction.
🤝 1
i
I got you, thank you - your explanation makes sense to me. Yes, my main question was only about the issue that I can’t detect a crash if it happens, nowhere, even if I share the report with Apple, and whether that’s a tradeoff for me
r
For Kotlin exceptions to be useful/visible in crash reporting tools you need some addition setup. You can create your own or use a library such as (my) NSExceptionKt or Kermit or something. Some more details: https://github.com/rickclephas/NSExceptionKt FYI even with those tools there is a known issue with CMP: https://youtrack.jetbrains.com/issue/KT-86576/K-N-C-terminate-handler-setup-order-issue
🤝 1
kodee loving 2
i
@Rick Clephas Thank you, I checked quickly.... I correctly understand that this tool can help me have a more informative stack trace, but not increase the chance of a record crash at a random moment if it's happens?
r
Yes. Fatal Kotlin crashes should always generate some sort of crash report. But without additional setup those lack any useful information.
🤝 1
i
Thank you for the help
👍🏻 1