From ededc5370d23577c7a6d1ffe3694b81d54f16eea Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 8 Sep 2026 10:28:41 +0200 Subject: [PATCH 1/2] fix(compose): Publish the foundation-layout floor SentryTraced needs SentryTraced calls Box, an inline composable, so BoxKt.maybeCachedBoxMeasurePolicy ends up baked into sentry-compose's own bytecode. That method only exists from foundation-layout 1.7.0, yet androidMain reaches the class transitively through compileOnly(material3), so the published metadata named no compose dependency at all. A consumer resolving foundation-layout 1.6.x got a NoSuchMethodError with nothing to warn them. Publish a dependency constraint rather than a dependency, so apps that never touch SentryTraced are not pulled onto compose. Our own build had the same skew. The catalog asked for 1.6.3 while the unit test runtime only reached 1.7.0 by way of an unrelated androidx constraint on foundation ("prevents a regression in Overscroll"), one that navigation 2.4.2's request for 1.0.1 was quietly losing to. Raise the catalog to 1.7.0 and navigation to 2.8.0, the first release that stops asking for compose 1.0.1, so the resolved version is the one we declare. The androidUnitTest foundation dependency added in #6057 only existed to drag that constraint onto the test graph. --- gradle/libs.versions.toml | 4 ++-- sentry-compose/build.gradle.kts | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) 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() From 6c2c92c040fcfc7aa45cbbbad3bdacf7c4701e13 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 8 Sep 2026 10:30:09 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) 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