sentry-kotlin-multiplatform icon indicating copy to clipboard operation
sentry-kotlin-multiplatform copied to clipboard

Support Compose Multiplatform

Open buenaflor opened this issue 2 years ago • 4 comments

Note

You can install and use the Sentry KMP SDK in your CMP app and use it, however we currently do not run any tests against CMP or provide any CMP specific integrations such as user interaction tracking etc...

I have set up a small docs page on using Sentry KMP with Compose Multiplatform

This issue is about natively supporting it via a separate sentry-compose-multiplatform package, guaranteeing stability and adding native CMP integrations.


Description

Since Compose Multiplatform is getting quite popular it might make sense

Features

  • [ ] Performance monitoring
  • [ ] Breadcrumbs
  • [ ] CMP specific contexts

More suggestions are welcome

Please upvote if you are interested

buenaflor avatar Feb 19 '24 22:02 buenaflor

This would be super useful!

Features: ideally it could do everything that the Sentry Android gradle plugin currently does (automatic breadcrumbs, interaction tracking, automatic traces, automatic debug symbols uploads etc.).

We're currently using the KMP plugin in our new CMP app as suggested here and in the docs. So far it seems to work well (minus most of the automatic breadcrumbs and traces) - our Android app is still in Open Beta but already has 200+ daily users (iOS not yet).

For the debug symbols upload: as the earlier version of the CMP docs referenced the KMP upload debug symbols docs, we got it to work by adding the Sentry Android gradle plugin in composeApp but excluding sentry-kotlin-extensions for the iOS targets, and then using the sentry { ... } configuration block. It's a bit "hacky" but seems to work for us for now, hoping that this feature will be implemented a CMP package will supported by Sentry soon!

lwld avatar Jul 28 '25 16:07 lwld

@lwld thank you for sharing your progress!

For the debug symbols upload: as the earlier version of the CMP docs referenced the KMP upload debug symbols docs, we got it to work by adding the Sentry Android gradle plugin in composeApp but excluding sentry-kotlin-extensions for the iOS targets, and then using the sentry { ... } configuration block. It's a bit "hacky" but seems to work for us for now, hoping that this feature will be implemented a CMP package will supported by Sentry soon!

Why not just add the Android gradle plugin to androidMain and the "Run Script" phase to XCode?

marioortizmanero avatar Aug 18 '25 09:08 marioortizmanero

@marioortizmanero

Why not just add the Android gradle plugin to androidMain and the "Run Script" phase to XCode?

I'm not sure how to do achieve that - do you have a working example? How is it possible to add a plugin only to androidMain? Our current workaround is working ok for now, so we're waiting for Sentry to implement this hopefully in the KMP/CMP plugin.

lwld avatar Aug 19 '25 15:08 lwld

Hey, any news here? 😀

raudonikis avatar Nov 12 '25 20:11 raudonikis