Conversation
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
📲 Install BuildsAndroid
|
NoSuchMethodError for LayoutCoordinates.localBoundingBoxOf$default on Compose touch dispatch with AGP 8.13 and minSdk < 24
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| d15471f | 310.66 ms | 368.19 ms | 57.53 ms |
| 9054d65 | 330.94 ms | 403.24 ms | 72.30 ms |
| b77456b | 393.26 ms | 441.10 ms | 47.84 ms |
| 96449e8 | 361.30 ms | 423.39 ms | 62.09 ms |
| ee747ae | 357.79 ms | 421.84 ms | 64.05 ms |
| a416a65 | 295.53 ms | 373.74 ms | 78.21 ms |
| ab8a72d | 316.24 ms | 356.38 ms | 40.14 ms |
| 1564554 | 323.06 ms | 336.68 ms | 13.62 ms |
| b3d8889 | 371.69 ms | 432.96 ms | 61.26 ms |
| d15471f | 315.20 ms | 370.22 ms | 55.02 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
| 9054d65 | 1.58 MiB | 2.29 MiB | 723.38 KiB |
| b77456b | 1.58 MiB | 2.12 MiB | 548.11 KiB |
| 96449e8 | 1.58 MiB | 2.11 MiB | 539.35 KiB |
| ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
| a416a65 | 1.58 MiB | 2.12 MiB | 555.26 KiB |
| ab8a72d | 1.58 MiB | 2.12 MiB | 551.55 KiB |
| 1564554 | 1.58 MiB | 2.20 MiB | 635.33 KiB |
| b3d8889 | 1.58 MiB | 2.10 MiB | 535.06 KiB |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Pass
clipBounds = trueexplicitly toLayoutCoordinates.localBoundingBoxOf(...)in:sentry-compose/src/androidMain/kotlin/io/sentry/compose/SentryComposeHelper.ktsentry-android-replay/src/main/java/io/sentry/android/replay/util/Nodes.ktBoth call sites previously relied on the Kotlin-generated
localBoundingBoxOf$defaultstatic bridge on theLayoutCoordinatesinterface.💡 Motivation and Context
After the recent AGP bump to
8.13.1(#5063, commitce4b2c14da), dispatching a touch event to a Compose view crashes with:Root cause is AGP 8.13's D8 desugaring. When
minSdk < 24, D8 moves interface static methods (including Kotlin's$defaultbridges) off the interface and onto a synthesizedLayoutCoordinates$-CCcompanion class. Confirmed viadexdumpon the built sample APK:LayoutCoordinatesinterface → only the abstractlocalBoundingBoxOf, no$defaultLayoutCoordinates$-CC→ haslocalBoundingBoxOf$defaultBut the call site in
SentryComposeHelperKt.boundsInWindowstill invokesLayoutCoordinates.localBoundingBoxOf$default— D8 rewrote the target class but not the invoke instruction in our library bytecode, producing theNoSuchMethodErrorat runtime.Passing
clipBounds = trueexplicitly skips the$defaultbridge entirely — the compiler emitsinvokeinterface LayoutCoordinates.localBoundingBoxOf(LayoutCoordinates, Z)Rectdirectly on the abstract member, which is present on the interface across all relevant Compose versions and doesn't need desugaring.Who is affected
Customers on minSdk < 24 with non-minified builds on AGP 8.13.x:
Minified release builds are safe, so shipped production apps are mostly fine. The problem mainly bites during local debug builds of customer apps that set
minSdkbelow 24.Why CI didn't catch this
.github/workflows/agp-matrix.yml) currently tests8.7.0,8.8.0,8.9.0— all older than the new default8.13.1. It only guards against older-AGP regressions, not newer-AGP ones.integration-tests-ui.yml) do run with default AGP 8.13.1, but they assemble thereleasevariant with minify enabled — R8 hides the bug.I'll open follow-ups to:
8.13.1(and ideally a rolling "latest") to the AGP matrix.💚 How did you test it?
Reproduced locally and verified the fix on a connected Android 15 device:
./gradlew :sentry-samples:sentry-samples-android:assembleDebug adb install -r -t sentry-samples/sentry-samples-android/build/outputs/apk/debug/sentry-samples-android-debug.apk # Launch io.sentry.samples.android, navigate to a Compose screen, tap a target.Before the fix: crash on first Compose touch with the
NoSuchMethodErrorabove.After the fix: no crash, click breadcrumbs are generated as expected.
dexdumpverification on the rebuilt APK confirms the call site is now:— no
$defaultreference, so nothing for D8 to desugar inconsistently.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
8.13.1(and a rollinglatest) to the AGP matrix workflow.