Skip to content

Commit 16a07c4

Browse files
authored
fix(compose): NoSuchMethodError for LayoutCoordinates.localBoundingBoxOf$default on Compose touch dispatch with AGP 8.13 and minSdk < 24 (#5302)
* fix(compose): pass clipBounds explicitly to avoid D8 desugaring mismatch * changelog
1 parent 35c8ffa commit 16a07c4

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Fixes
6+
7+
- Fix `NoSuchMethodError` for `LayoutCoordinates.localBoundingBoxOf$default` on Compose touch dispatch with AGP 8.13 and `minSdk < 24` ([#5302](https://github.com/getsentry/sentry-java/pull/5302))
8+
59
### Dependencies
610

711
- Bump Native SDK from v0.13.6 to v0.13.7 ([#5296](https://github.com/getsentry/sentry-java/pull/5296))

sentry-android-replay/src/main/java/io/sentry/android/replay/util/Nodes.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ internal fun LayoutCoordinates.boundsInWindow(rootCoordinates: LayoutCoordinates
167167
val rootWidth = root.size.width.toFloat()
168168
val rootHeight = root.size.height.toFloat()
169169

170-
val bounds = root.localBoundingBoxOf(this)
170+
// pass clipBounds explicitly to avoid the `localBoundingBoxOf$default` bridge that AGP 8.13's D8
171+
// desugars inconsistently on minSdk < 24
172+
val bounds = root.localBoundingBoxOf(this, true)
171173
val boundsLeft = bounds.left.fastCoerceIn(0f, rootWidth)
172174
val boundsTop = bounds.top.fastCoerceIn(0f, rootHeight)
173175
val boundsRight = bounds.right.fastCoerceIn(0f, rootWidth)

sentry-compose/src/androidMain/kotlin/io/sentry/compose/SentryComposeHelper.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ public fun LayoutCoordinates.boundsInWindow(rootCoordinates: LayoutCoordinates?)
8686
val rootWidth = root.size.width.toFloat()
8787
val rootHeight = root.size.height.toFloat()
8888

89-
val bounds = root.localBoundingBoxOf(this)
89+
// pass clipBounds explicitly to avoid the `localBoundingBoxOf$default` bridge that AGP 8.13's D8
90+
// desugars inconsistently on minSdk < 24
91+
val bounds = root.localBoundingBoxOf(this, true)
9092
val boundsLeft = bounds.left.fastCoerceIn(0f, rootWidth)
9193
val boundsTop = bounds.top.fastCoerceIn(0f, rootHeight)
9294
val boundsRight = bounds.right.fastCoerceIn(0f, rootWidth)

0 commit comments

Comments
 (0)