Status Update
Comments
pa...@hinge.co <pa...@hinge.co> #2
rocess: com.candybytes.danger, PID: 19211
10-07 07:50:27.310: E/AndroidRuntime(19211): java.lang.IndexOutOfBoundsException: offset(93) should be less than line limit(92)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.text.TextLine.measure(TextLine.java:389)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.text.Layout.getHorizontal(Layout.java:1246)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.text.Layout.getHorizontal(Layout.java:1222)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.text.Layout.getPrimaryHorizontal(Layout.java:1192)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.text.Layout.getPrimaryHorizontal(Layout.java:1181)
10-07 07:50:27.310: E/AndroidRuntime(19211): at a2.g.a(SourceFile:101)
10-07 07:50:27.310: E/AndroidRuntime(19211): at a2.u0.f(SourceFile:10)
10-07 07:50:27.310: E/AndroidRuntime(19211): at z1.a.c(SourceFile:43)
10-07 07:50:27.310: E/AndroidRuntime(19211): at z1.v.b(SourceFile:42)
10-07 07:50:27.310: E/AndroidRuntime(19211): at androidx.compose.ui.platform.s$d.addExtraDataToAccessibilityNodeInfo(SourceFile:164)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.view.AccessibilityInteractionController.populateAccessibilityNodeInfoForView(AccessibilityInteractionController.java:430)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:363)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.view.AccessibilityInteractionController.-$$Nest$mfindAccessibilityNodeInfoByAccessibilityIdUiThread(Unknown Source:0)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1647)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.os.Handler.dispatchMessage(Handler.java:106)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.os.Looper.loopOnce(Looper.java:201)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.os.Looper.loop(Looper.java:288)
10-07 07:50:27.310: E/AndroidRuntime(19211): at android.app.ActivityThread.main(ActivityThread.java:7898)
10-07 07:50:27.310: E/AndroidRuntime(19211): at java.lang.reflect.Method.invoke(Native Method)
10-07 07:50:27.310: E/AndroidRuntime(19211): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
10-07 07:50:27.310: E/AndroidRuntime(19211): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
pa...@hinge.co <pa...@hinge.co> #3
Exception java.lang.IndexOutOfBoundsException: offset(7) should be less than line limit(6)
at android.text.TextLine.measure (TextLine.java:353)
at android.text.Layout.getHorizontal (Layout.java:1213)
at android.text.Layout.getHorizontal (Layout.java:1190)
at android.text.Layout.getPrimaryHorizontal (Layout.java:1160)
at android.text.Layout.getPrimaryHorizontal (Layout.java:1149)
at ckl.d (ckl.java:1)
at ckl.a (ckl.java:38)
at clb.e (clb.java:1)
at cja.r (cja.java:7)
at cka.l (cka.java:5)
at cdl.addExtraDataToAccessibilityNodeInfo (cdl.java:15)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos (AccessibilityInteractionController.java:1104)
at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread (AccessibilityInteractionController.java:342)
at android.view.AccessibilityInteractionController.access$400 (AccessibilityInteractionController.java:75)
at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage (AccessibilityInteractionController.java:1460)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:223)
at android.app.ActivityThread.main (ActivityThread.java:7664)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:947)
kl...@google.com <kl...@google.com>
kl...@google.com <kl...@google.com> #4
Exception java.lang.IndexOutOfBoundsException: offset(261) should be less than line limit(260)
at android.text.TextLine.measure (TextLine.java:389)
at android.text.Layout.getHorizontal (Layout.java:1246)
at android.text.Layout.getHorizontal (Layout.java:1222)
at android.text.Layout.getPrimaryHorizontal (Layout.java:1192)
at android.text.Layout.getPrimaryHorizontal (Layout.java:1181)
at androidx.compose.ui.text.android.LayoutHelper.getDownstreamHorizontal (LayoutHelper.kt:353)
at androidx.compose.ui.text.android.TextLayout.getLayoutHelper (TextLayout.kt:332)
at androidx.compose.ui.text.MultiParagraph.requireIndexInRange (MultiParagraph.java:750)
at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat$MyNodeProvider.addExtraDataToAccessibilityNodeInfo (AndroidComposeViewAccessibilityDelegateCompat.android.kt)
at android.view.AccessibilityInteractionController.populateAccessibilityNodeInfoForView (AccessibilityInteractionController.java:430)
at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread (AccessibilityInteractionController.java:363)
at android.view.AccessibilityInteractionController.-$$Nest$mfindAccessibilityNodeInfoByAccessibilityIdUiThread (AccessibilityInteractionController.java)
at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage (AccessibilityInteractionController.java:1647)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:201)
at android.os.Looper.loop (Looper.java:288)
at android.app.ActivityThread.main (ActivityThread.java:7898)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)
si...@google.com <si...@google.com>
kl...@google.com <kl...@google.com> #5
Getting the same error on a OnePlus 8 Pro running Android 11:
java.lang.IndexOutOfBoundsException: offset(7) should be less than line limit(6)
android.text.TextLine.measure(TextLine.java:353)
android.text.Layout.getHorizontal(Layout.java:1213)
android.text.Layout.getHorizontal(Layout.java:1190)
android.text.Layout.getPrimaryHorizontal(Layout.java:1160)
android.text.Layout.getPrimaryHorizontal(Layout.java:1149)
androidx.compose.ui.text.android.LayoutHelper.getDownstreamHorizontal(LayoutHelper.java:90)
androidx.compose.ui.text.android.TextLayout.getPrimaryHorizontal(TextLayout.java:10)
androidx.compose.ui.text.android.TextLayout.getBoundingBox(TextLayout.java:41)
androidx.compose.ui.text.AndroidParagraph.getBoundingBox(AndroidParagraph.java:41)
androidx.compose.ui.text.MultiParagraph.getBoundingBox(MultiParagraph.java:40)
androidx.compose.ui.text.TextLayoutResult.getBoundingBox(TextLayoutResult.java:40)
androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.addExtraDataToAccessibilityNodeInfoHelper(AndroidComposeViewAccessibilityDelegateCompat.java:162)
androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat$MyNodeProvider.addExtraDataToAccessibilityNodeInfo(AndroidComposeViewAccessibilityDelegateCompat.java:162)
android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:1104)
android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:342)
android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1460)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loop(Looper.java:223)
android.app.ActivityThread.main(ActivityThread.java:7701)
java.lang.reflect.Method.invoke(Method.java:0)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
kl...@google.com <kl...@google.com> #6
I am getting the same issue in firebase test lab; on Pixel 7 API 33. Unable to replicate it. Happens in a compose based ModalBottomSheetLayout with a parent Column, several child Rows and a LazyColumn that holds rows with text.
android.text.TextLine.measure (TextLine.java:389)
android.text.Layout.getHorizontal (Layout.java:1246)
android.text.Layout.getHorizontal (Layout.java:1222)
android.text.Layout.getPrimaryHorizontal (Layout.java:1192)
android.text.Layout.getPrimaryHorizontal (Layout.java:1181)
androidx.compose.ui.text.android.LayoutHelper.getDownstreamHorizontal (LayoutHelper.kt:353)
androidx.compose.ui.text.android.LayoutHelper.getHorizontalPosition (LayoutHelper.kt:236)
androidx.compose.ui.text.android.TextLayout.getPrimaryHorizontal (TextLayout.kt:503)
androidx.compose.ui.text.android.TextLayout.getBoundingBox (TextLayout.java:675)
androidx.compose.ui.text.AndroidParagraph.getBoundingBox (AndroidParagraph.android.kt:312)
androidx.compose.ui.text.MultiParagraph.getBoundingBox (MultiParagraph.java:488)
androidx.compose.ui.text.TextLayoutResult.getBoundingBox (TextLayoutResult.kt:527)
androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.addExtraDataToAccessibilityNodeInfoHelper (AndroidComposeViewAccessibilityDelegateCompat.java:1439)
androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.access$addExtraDataToAccessibilityNodeInfoHelper (AndroidComposeViewAccessibilityDelegateCompat.java:117)
androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat$MyNodeProvider.addExtraDataToAccessibilityNodeInfo (AndroidComposeViewAccessibilityDelegateCompat.android.kt:2460)
android.view.AccessibilityInteractionController.populateAccessibilityNodeInfoForView (AccessibilityInteractionController.java:430)
android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread (AccessibilityInteractionController.java:363)
android.view.AccessibilityInteractionController.-$$Nest$mfindAccessibilityNodeInfoByAccessibilityIdUiThread (AccessibilityInteractionController.java)
android.view.AccessibilityInteractionController$PrivateHandler.handleMessage (AccessibilityInteractionController.java:1647)
kl...@google.com <kl...@google.com> #7
We also started to receive this crash on error reports, after upgrading activity-compose
to 1.6.1.
Any update on this?
ap...@google.com <ap...@google.com> #8
Halil I vaguely remember that you fixed a similar issue recently or mentioned about it (a 1 off error for getHorizontalPosition).
Does this sound familiar?
java.lang.IndexOutOfBoundsException: measureLimit (120) is out of start (0) and limit (119) bounds
na...@google.com <na...@google.com> #9
Yes this is the same bug that we've investigated priorly. Both originate from AccessibilityDelegateCompat and use getBoundingBox
. The underlying issue is in the platform TextLayout but we can circumvent the issue by falling back to previous implementation for the last cursor position.
ju...@google.com <ju...@google.com> #10
I looked at this a bit more yesterday. Some of my findings include;
- This has always been buggy unfortunately. Previous getBoundingBox implementation also had a call to
getPrimaryHorizontal(offset)
that is the culprit from platform. getPrimaryHorizontal(offset)
always fails in a situation similar to following;- Text is ellipsized.
- Ellipsis region includes an LF character '\n'
- offset points to a character after this LF
- TextLine object in text layout is set with a start and limit on given text.
- Limit does not care about ellipsis but cares about LF characters. So, a text is always guaranteed to be partitioned into multiple lines in the existence of LF.
- Querying an ellipsized offset which would have been on a different line anyway causes a crash on TextLine since TextLine thinks that the given offset is out of bounds.
There is a comment in TextLayout.kt
that references a similar problem with platform text layout
sv...@gmail.com <sv...@gmail.com> #11
Is there a recommended work around for this? Our team is seeing a rather appreciable number of reports for this crash.
Thank you!
androidx.appcompat:appcompat:1.6.1
androidx.compose:compose-bom:2023.04.00
fu...@gmail.com <fu...@gmail.com> #12
fu...@gmail.com <fu...@gmail.com> #13
Branch: androidx-main
commit 9e49803f6ce45ec5a3a1899101485f13036c6432
Author: Halil Ozercan <halilibo@google.com>
Date: Wed May 10 17:23:14 2023
Fix getBoundingBox crashing for some ellipsized indices
This CL fixes a bug where getBoundingBox throws an index out of bounds error when the queried offset is in the ellipsized region and comes after a LINE_FEED(\n) character.
Additionally we are converging some exception types in AndroidParagraph to use `IllegalArgumentException` via `require` function, instead of `AssertionError`.
Fix:
Relnote: "`Paragraph` methods that used to throw `AssertionError` for out of bounds offsets now throw `IllegalArgumentException` as `MultiParagraph` does."
Test: :compose:ui:ui-text:cAT
Change-Id: I549d3ec936afbd941361690d1f16fadc4998670a
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationBoundingBoxTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/AndroidParagraph.android.kt
M text/text/src/main/java/androidx/compose/ui/text/android/LayoutHelper.kt
Description
- Jetpack Compose component used: ClickableText with AnnotatedString including UrlAnnotation
- Android Studio Build: Android Studio Chipmunk | 2021.2.1 Patch 2
Build #AI-212.5712.43.2112.8815526, built on July 10, 2022
- Kotlin version: 1.7.20
- Devices/Android versions reproduced on: Android 30, 33 on Pixel 4As
- Keyboard (i.e. Gboard, Samsung, etc): Stock Google keyboard
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue:
- A screenrecord or screenshots showing the issue (if UI related). This is included with the sample project but I attached it again here.
- Stack trace (if applicable) - N/A
There is a bug where the recently introduced UrlAnnotation is read correctly by Talkback, but the onClick is not called, so the link is not opened.
Steps to Reproduce:
1. Turn on Talkback in Accessibility settings
2. Run app
3. App will display a single line of text
4. Part of this text will be a URLAnnotation containing a link
5. Open the Talkback action menu per the prompt
6. Select "Links" in Talkback menu
7. Select the link to trigger the onClick method call, which opens the browser.
Expected:
1.Talkback correctly recognizes the link in the text
2. Talkback shows the link in the Talkback menu
3. When the link is selected in the Talkback menu, the onClick is called in ClickableText and the user is navigated to the browser.
Actual:
1. The onClick for the ClickableText is never called. Note that it is not the browser navigation that is broken. This can be confirmed using the logs in the sample app provided.