Status Update
Comments
ti...@google.com <ti...@google.com>
se...@candybytes.com <se...@candybytes.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
ku...@gmail.com <ku...@gmail.com> #3
26...@gmail.com <26...@gmail.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
jo...@gmail.com <jo...@gmail.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)
de...@greyarea.no <de...@greyarea.no> #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)
ja...@ntucenterprise.sg <ja...@ntucenterprise.sg> #7
We also started to receive this crash on error reports, after upgrading activity-compose
to 1.6.1.
Any update on this?
si...@google.com <si...@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
ha...@google.com <ha...@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.
ha...@google.com <ha...@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
jm...@gmail.com <jm...@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
si...@empiriecom.com <si...@empiriecom.com> #12
we are also interested in a fix or workaround for this.
Best regards!
Versions used:
- androidx.activity:activity-compose:1.6.0
- androidx.compose.ui:ui:1.3.3
- androidx.compose.ui:ui-text:1.3.3
ap...@google.com <ap...@google.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
ha...@google.com <ha...@google.com> #14
We have attempted a blind fix since we couldn't reproduce the issue with the exact stacktrace. However, we still have high confidence that this fix should address the original issue.
Top of the stacktrace in all reported cases is a very isolated path that tells us that all crashes were highly likely resulted from querying a bounding box in an ellipsized region of a text layout. Attempted fix solves this particular issue.
wi...@dcsg.com <wi...@dcsg.com> #15
pr...@google.com <pr...@google.com> #16
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui-text:1.6.0-alpha01
androidx.compose.ui:ui-text-android:1.6.0-alpha01
Description
Version used: androidx.activity:activity-compose:1.5.0
Theme used: -
Devices/Android versions reproduced on: Nokia 1 Android 8.1 (SDK 27) 240DPI + 480 x 854
Description: This crash log came from pre-launch report. The crash occurred only with that small device noted above. The "reviews" section is the last widget in that LazyColumn shown in screenrecord. There are no any editable textfields in that page where the app crashes.
Screenrecord of the crash:
Stacktrace:
FATAL EXCEPTION: main
Process:
java.lang.IndexOutOfBoundsException: measureLimit (120) is out of start (0) and limit (119) bounds
at android.text.TextLine.handleRun(TextLine.java:990)
at android.text.TextLine.measureRun(TextLine.java:417)
at android.text.TextLine.measure(TextLine.java:307)
at android.text.Layout.getHorizontal(Layout.java:1094)
at android.text.Layout.getHorizontal(Layout.java:1072)
at android.text.Layout.getPrimaryHorizontal(Layout.java:1043)
at android.text.Layout.getPrimaryHorizontal(Layout.java:1033)
at u1.b.a(Unknown Source:4)
at u1.b.b(Unknown Source:6)
at u1.n.g(SourceFile:2)
at b2.a.c(Unknown Source:10)
at t1.u.b(SourceFile:7)
at androidx.compose.ui.platform.r$d.addExtraDataToAccessibilityNodeInfo(SourceFile:14)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:980)
at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:336)
at android.view.AccessibilityInteractionController.-wrap1(Unknown Source:0)
at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1324)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)