diff --git a/CHANGELOG.md b/CHANGELOG.md index ad76dd5388..5a7e290e1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Fixes + +- 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)) + ### Dependencies - Bump Native SDK from v0.13.6 to v0.13.7 ([#5296](https://github.com/getsentry/sentry-java/pull/5296)) diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/util/Nodes.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/util/Nodes.kt index cd9e3dd208..2882b2113b 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/util/Nodes.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/util/Nodes.kt @@ -167,7 +167,9 @@ internal fun LayoutCoordinates.boundsInWindow(rootCoordinates: LayoutCoordinates val rootWidth = root.size.width.toFloat() val rootHeight = root.size.height.toFloat() - val bounds = root.localBoundingBoxOf(this) + // pass clipBounds explicitly to avoid the `localBoundingBoxOf$default` bridge that AGP 8.13's D8 + // desugars inconsistently on minSdk < 24 + val bounds = root.localBoundingBoxOf(this, true) val boundsLeft = bounds.left.fastCoerceIn(0f, rootWidth) val boundsTop = bounds.top.fastCoerceIn(0f, rootHeight) val boundsRight = bounds.right.fastCoerceIn(0f, rootWidth) diff --git a/sentry-compose/src/androidMain/kotlin/io/sentry/compose/SentryComposeHelper.kt b/sentry-compose/src/androidMain/kotlin/io/sentry/compose/SentryComposeHelper.kt index 1f93f75875..10d02103ba 100644 --- a/sentry-compose/src/androidMain/kotlin/io/sentry/compose/SentryComposeHelper.kt +++ b/sentry-compose/src/androidMain/kotlin/io/sentry/compose/SentryComposeHelper.kt @@ -86,7 +86,9 @@ public fun LayoutCoordinates.boundsInWindow(rootCoordinates: LayoutCoordinates?) val rootWidth = root.size.width.toFloat() val rootHeight = root.size.height.toFloat() - val bounds = root.localBoundingBoxOf(this) + // pass clipBounds explicitly to avoid the `localBoundingBoxOf$default` bridge that AGP 8.13's D8 + // desugars inconsistently on minSdk < 24 + val bounds = root.localBoundingBoxOf(this, true) val boundsLeft = bounds.left.fastCoerceIn(0f, rootWidth) val boundsTop = bounds.top.fastCoerceIn(0f, rootHeight) val boundsRight = bounds.right.fastCoerceIn(0f, rootWidth)