Kotlin multiplatform integration

Hi!
I am having some trouble trying to integrate Sentry into a kotlin multiplatform project. The iOS integration went smoothly following the documentation and so did the Android side of the app but I can’t figure out how to set up the common part of the app. I’m trying to do the following in the common build.gradle ($sentry_version is 3.1.1).
kotlin { sourceSets { commonMain { dependencies { implementation "io.sentry:sentry:$sentry_version" } } } }

However, I can never import sentry once in my code. The Kotlin Sentry page (https://sentry.io/for/kotlin/) doesn’t give more information and the link to the documentation sends to a Page not Found.
Is Sentry not supporting Kotlin multiplatform or am I doing something wrong?

Thanks!

Thanks for pointing out the broken link. I’ve opened a PR to fix that.

You seem to trying to import the sentry maven package, which is compatible with JVM 8 and Android only.
Would be nice to get an example of Kotlin Multiplatform up to see how support is right now, but I’m unaware of any examples so far. Worth investigating.

We have an experimental Sentry SDK for Kotlin Multiplatform here https://github.com/getsentry/sentry-kotlin-multiplatform. It was done during a hack week to play around with Kotlin Multiplatform. Maybe this helps to set up Sentry for your project. Feel free to open up PRs and help us to move forward with it.

1 Like