Status Update
Comments
ma...@google.com <ma...@google.com> #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)
ch...@google.com <ch...@google.com> #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)
ma...@google.com <ma...@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)
mo...@google.com <mo...@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)
ch...@google.com <ch...@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)
ch...@google.com <ch...@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?
mo...@google.com <mo...@google.com>
mo...@google.com <mo...@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
ch...@google.com <ch...@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.
mo...@google.com <mo...@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
ap...@google.com <ap...@google.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
Description
Currently I'm using
Modifier.onPositioned
a lot to know the laid out size of a node, butonPositioned
is wasteful for this, especially when it's in a scroller.Ideally I want just a
onSizeChanged
modifier to know only when the size changes.