diff --git a/CHANGELOG.md b/CHANGELOG.md index 32afac6547..7e6fbff335 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,11 @@ - Allow `0.0` error sample rate ([#2573](https://github.com/getsentry/sentry-java/pull/2573)) - Fix memory leak in WebFlux related to an ever growing stack ([#2580](https://github.com/getsentry/sentry-java/pull/2580)) - Use the same hub in WebFlux exception handler as we do in WebFilter ([#2566](https://github.com/getsentry/sentry-java/pull/2566)) +- Switch upstream Jetpack Compose dependencies to `compileOnly` in `sentry-compose-android` ([#2578](https://github.com/getsentry/sentry-java/pull/2578)) + - NOTE: If you're using Compose Navigation/User Interaction integrations, make sure to have the following dependencies on the classpath as we do not bring them in transitively anymore: + - `androidx.navigation:navigation-compose:` + - `androidx.compose.runtime:runtime:` + - `androidx.compose.ui:ui:` ## 6.14.0 diff --git a/sentry-compose/build.gradle.kts b/sentry-compose/build.gradle.kts index aae846513e..601d06f617 100644 --- a/sentry-compose/build.gradle.kts +++ b/sentry-compose/build.gradle.kts @@ -38,10 +38,9 @@ kotlin { sourceSets { val commonMain by getting { dependencies { - api(compose.runtime) - api(compose.ui) + compileOnly(compose.runtime) + compileOnly(compose.ui) - implementation(Config.Libs.kotlinStdLib) api(projects.sentryComposeHelper) } } @@ -50,7 +49,7 @@ kotlin { api(projects.sentry) api(projects.sentryAndroidNavigation) - api(Config.Libs.composeNavigation) + compileOnly(Config.Libs.composeNavigation) implementation(Config.Libs.lifecycleCommonJava8) } } @@ -59,6 +58,7 @@ kotlin { implementation(Config.TestLibs.kotlinTestJunit) implementation(Config.TestLibs.mockitoKotlin) implementation(Config.TestLibs.mockitoInline) + implementation(Config.Libs.composeNavigation) } } } diff --git a/sentry-compose/proguard-rules.pro b/sentry-compose/proguard-rules.pro index d2c978a746..a711d8c006 100644 --- a/sentry-compose/proguard-rules.pro +++ b/sentry-compose/proguard-rules.pro @@ -4,6 +4,13 @@ -keep class io.sentry.compose.gestures.ComposeGestureTargetLocator { (...); } -keepnames interface androidx.compose.ui.node.Owner +# R8 will warn about missing classes if people don't have androidx.compose-navigation on their +# classpath, but this is fine, these classes are used in an internal class which is only used when +# someone is using withSentryObservableEffect extension function (which, in turn, cannot be used +# without having androidx.compose-navigation on the classpath) +-dontwarn androidx.navigation.NavController$OnDestinationChangedListener +-dontwarn androidx.navigation.NavController + # To ensure that stack traces is unambiguous # https://developer.android.com/studio/build/shrink-code#decode-stack-trace -keepattributes LineNumberTable,SourceFile diff --git a/sentry/src/main/java/io/sentry/SentryOptions.java b/sentry/src/main/java/io/sentry/SentryOptions.java index 190db1798a..0c1b7d0e15 100644 --- a/sentry/src/main/java/io/sentry/SentryOptions.java +++ b/sentry/src/main/java/io/sentry/SentryOptions.java @@ -1660,7 +1660,7 @@ public void setProfilesSampler(final @Nullable ProfilesSamplerCallback profilesS /** * Sets the profilesSampleRate. Can be anything between 0.0 and 1.0 or null (default), to disable - * it. It’s dependent on the {{@link SentryOptions#setTracesSampleRate(Double)} } If a transaction + * it. It's dependent on the {{@link SentryOptions#setTracesSampleRate(Double)} } If a transaction * is sampled, then a profile could be sampled with a probability given by profilesSampleRate. * * @param profilesSampleRate the sample rate