Closed tfcporciuncula closed 8 months ago
Hi @tfcporciuncula, thanks for the feedback!
This is a limitation of the used cinterop approach, both types are actually the same though they have different packages in Kotlin. I did some quick testing and you should be able to force cast the event
:
import com.rickclephas.kmp.nsexceptionkt.sentry.cinterop.SentryEvent as NSExceptionKtSentryEvent
options?.setBeforeSend { event ->
dropKotlinCrashEvent(event as NSExceptionKtSentryEvent?) as SentryEvent?
}
Let me know if that is also working in your application.
Thanks for the quick response! This definitely compiles in our project and so far everything seems to be working as expected 🎉
I'm still wrapping my head around a good setup on our side so I might still be missing something, but so far so good and I'll report back if I find any issues.
I'm getting a dyld[58117]: missing symbol called
in asSentryException
as https://github.com/rickclephas/NSExceptionKt/blob/222bd7a5e0a8e8c1b6bb133257246ea1a83581dc/nsexception-kt-sentry/src/commonMain/kotlin/com/rickclephas/kmp/nsexceptionkt/sentry/Sentry.kt#L90C9-L90C52 , is that related?
What Sentry version were the headers pulled from, thinking I might try to exactly match that.
@hbmartin that doesn't seem related. Could you please create an issue for that with the exact error and missing symbol? The symbols should all be available in the Sentry v7.21.0.
As of v1.0.0-BETA-1 the Kotlin implementation of NSExceptionKt no longer depends on specific reporter implementations. Note: the Sentry implementation is now deprecated in favour of the official Sentry Kotlin Multiplatform SDK.
I'm following the "Add dependencies on a Pod library" docs to add Sentry as a dependency on the Kotlin side because I want to be able to write my own Kermit integration, also on the Kotlin side.
After integrating NSExceptionKt, I realized I'm unable to finish the setup because when I try to call this:
I get this error:
I believe this is the culprit, as we're trying to add Sentry already as part of NSExceptionKt. Is there anything I can do on my end to work around this issue?