diff --git a/CHANGELOG.md b/CHANGELOG.md index c4ef4c0bac..25e1e3787d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - `SentryTraced` now checks for its owning transaction dynamically rather than once per app process. The latter caused `SentryTraced` spans to be dropped process-wide once the original transaction finished ([#6057](https://github.com/getsentry/sentry-java/pull/6057)) - Fix typos in Spring GraphQL integration names (`GrahQL` to `GraphQL`) ([#6061](https://github.com/getsentry/sentry-java/pull/6061)) +- Publish an `androidx.compose.foundation:foundation-layout:1.7.0` version constraint from `sentry-compose` ([#6071](https://github.com/getsentry/sentry-java/pull/6071)) + - `SentryTraced` inlines `Box`, so its bytecode calls a measure policy that only exists from 1.7.0. Apps resolving an older `foundation-layout` hit a `NoSuchMethodError` ## 8.55.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0e95a4cd13..eef057267c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,9 +2,9 @@ animalsniffer = "2.0.1" apollo = "2.5.9" androidxLifecycle = "2.2.0" -androidxNavigation = "2.4.2" +androidxNavigation = "2.8.0" androidxTestCore = "1.7.0" -androidxCompose = "1.6.3" +androidxCompose = "1.7.0" asyncProfiler = "4.4" camerax = "1.4.0" composeCompiler = "1.5.14" diff --git a/sentry-compose/build.gradle.kts b/sentry-compose/build.gradle.kts index ad2c123731..7ab9edc0c6 100644 --- a/sentry-compose/build.gradle.kts +++ b/sentry-compose/build.gradle.kts @@ -62,7 +62,6 @@ kotlin { } getByName("androidUnitTest") { dependencies { - implementation(libs.androidx.compose.foundation) implementation(libs.androidx.compose.foundation.layout) implementation(libs.androidx.compose.ui.test.junit4) implementation(libs.androidx.navigation.compose) @@ -122,6 +121,18 @@ android { } } +// A constraint rather than a dependency: consumers that never touch SentryTraced should not be +// forced onto compose, but the ones that do must not resolve below the floor its bytecode needs. +dependencies { + constraints { + add("androidMainApi", libs.androidx.compose.foundation.layout) { + because( + "SentryTraced inlines Box, whose BoxKt.maybeCachedBoxMeasurePolicy only exists from 1.7.0" + ) + } + } +} + tasks.withType().configureEach { // Target version of the generated JVM bytecode. It is used for type resolution. jvmTarget = JavaVersion.VERSION_1_8.toString()