We are introducing KMP module in our existing Andr...
# multiplatform
a
We are introducing KMP module in our existing Android and iOS application (being developed fully native on both platforms for years). The codebase is large so want to keep the impact minimal. That's why starting with API layer only. My question is, what will be the best way to handle Crashalytics in KMP module? Specially for iOS? As we know, exceptions thrown in shared Kotlin code that reach iOS come across as unreadable
KotlinException
, My concern is how to properly handle them on iOS side too so that we can see the crashalytics with proper information to debug.
f
> tlin code that reach iOS come across as unreadable
KotlinException
Hello, that’s not right, you can catch the exception using the Kotlin annotation @Exception, but the difficulty is to unwrap and read correctly the error from Swift My advice is to avoid the usage of exception to handle error from swift and use enum or sealed class. To handle crash properly, you need to use library like NSExceptionKt or CrashKiOS.
a
I am concerned about whether I can see traceable data in Firebase Crashalytics to debug even for iOS.
f
so, use NSExceptionKt (or use Sentry instead of Crashlytics) and test yourself
But a crash from Kotlin/iOS is not as readable as a Swift one.
🥲 1
Also, enough readable 😄