fix(compose): add isImportantForBounds() to SentryTagModifierNode for compose-ui 1.11+#5672
Merged
antonis merged 4 commits intoJul 2, 2026
Conversation
… compose-ui 1.11+ compose-ui 1.11 added SemanticsModifierNode.isImportantForBounds() as an abstract method. SentryTagModifierNode was compiled against compose-ui 1.6.x, where the method does not exist, so its bytecode lacks an implementation. When an accessibility client (TalkBack, UiAutomator, adb uiautomator dump) traverses the Compose semantics tree at runtime on 1.11+, the JVM cannot find the method and throws AbstractMethodError. Adding fun isImportantForBounds(): Boolean = false without the override keyword (since the method is absent from the 1.6.x compile-time dependency) places the method in the class bytecode. The JVM satisfies the abstract method requirement via signature matching at runtime. SentryTagModifierNode stores only a semantic tag with no layout/visual effect, so false is the correct return value.
antonis
approved these changes
Jul 2, 2026
antonis
left a comment
Contributor
There was a problem hiding this comment.
Thank you for your work on this @tsushanth 🙇
The fix LGTM 🚀
I reproduced the issue on a Pixel 8 Pro (Android 16) using sentry-samples-android. Repro patch (apply on main):
diff --git a/sentry-samples/sentry-samples-android/build.gradle.kts b/sentry-samples/sentry-samples-android/build.gradle.kts
index xxxxxxx..yyyyyyy 100644
--- a/sentry-samples/sentry-samples-android/build.gradle.kts
+++ b/sentry-samples/sentry-samples-android/build.gradle.kts
@@ -178,6 +178,22 @@ sqldelight {
}
}
+// Repro for #5662: run the app against compose-ui 1.11.x while sentry-compose stays
+// compiled against its compileOnly compose-ui 1.6.3.
+configurations.configureEach {
+ resolutionStrategy.eachDependency {
+ if (
+ requested.group in
+ setOf(
+ "androidx.compose.ui",
+ "androidx.compose.foundation",
+ "androidx.compose.animation",
+ "androidx.compose.runtime",
+ )
+ ) {
+ useVersion("1.11.3")
+ }
+ }
+}
+
dependencies {
implementation(
kotlin(Config.kotlinStdLib, org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)
diff --git a/sentry-samples/sentry-samples-android/src/main/AndroidManifest.xml b/sentry-samples/sentry-samples-android/src/main/AndroidManifest.xml
index xxxxxxx..yyyyyyy 100644
--- a/sentry-samples/sentry-samples-android/src/main/AndroidManifest.xml
+++ b/sentry-samples/sentry-samples-android/src/main/AndroidManifest.xml
@@ -87,7 +87,7 @@
<activity
android:name=".compose.ComposeActivity"
- android:exported="false" />
+ android:exported="true" />
Confirmed that the fix on this PR resolves the crash 🎉
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.
Fixes #5662
Problem
compose-ui 1.11addedSemanticsModifierNode.isImportantForBounds()as an abstract method.SentryTagModifierNodewas compiled againstcompose-ui 1.6.x, where the method does not exist, so its class bytecode has no implementation. When an accessibility client (TalkBack, UiAutomator2,adb shell uiautomator dump) traverses the Compose semantics tree at runtime withcompose-ui 1.11+, the JVM cannot find the method and throws:Fix
Add
fun isImportantForBounds(): Boolean = falsetoSentryTagModifierNode.The
overridekeyword is intentionally omitted because the method is absent from thecompose-ui 1.6.xcompile-time dependency — usingoverridewould fail to compile. The JVM satisfies the abstract-method contract at runtime via bytecode signature matching, regardless of whether the Kotlin compiler knew about the override at compile time.SentryTagModifierNodestores only a semantic tag with no layout or visual effect, sofalseis the correct return value (it does not affect touch-bounds computation).Testing
Verified no public API changes (
./gradlew sentry-compose:apiCheckpasses —SentryTagModifierNodeis private, so no.apifile update required). The fix applies cleanly to the existingcompose-ui 1.6.xcompile target without version bumps.