Status Update
Comments
ti...@google.com <ti...@google.com>
se...@candybytes.com <se...@candybytes.com> #2
First of all thanks for this detailed issue.
This issue had been investigated thoroughly when it was first reported internally. The surprising detail in this report is that the issue is not reproducible before 1.7
. I will look into this.
The main problem with POBox is the fact that it is deprecated. Since 2021 Sony has been shipping new Xperia devices with Gboard pre-installed. Although we are aware that there is still a considerable amount of users still using POBox, the described behavior is caused by POBox's noncompliant behavior with InputConnection
and InputMethodManager
documentation. However, this is understandable since TextView
implementation was also not respecting the behavior that is expected from Editors.
Ultimately we have decided to enforce the documented behavior with specifically regards to when editors should call InputMethodManager.updateSelection
. Also, although unconfirmed, there were traces of possible custom code being included in Sony OEM images that changed how InputMethodManager was notified from TextView. If POBox also depended on something like this, it would be impossible for Compose code to replicate the same unknown behavior.
ku...@gmail.com <ku...@gmail.com> #3
Or is that option not available?
Even if the root cause is POBox, from the perspective of the app's customers, it looks like an app bug, so this issue is a blocker against updating Jetpack Compose.
26...@gmail.com <26...@gmail.com> #4
Just to be sure, it is dangerous to replace Compose TextField with Android View EditText as a workaround for this issue.
Compose 1.7 has a bug that causes ANR when the focus is on EditText.
Another View-related bug in Compose 1.7 is that an Android View is focused by calling FocusManager.clearFocus().
Perhaps there is a lack of testing of Compose 1.7 in combination with Android View. There is also a possibility that there are other fatal bugs related to View.
In other words, the only options for apps targeting the Japanese market that require POBox support are to continue using Compose 1.6 or to use EditText in combination with various workarounds.
jo...@gmail.com <jo...@gmail.com> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Halil Ozercan <
Link:
Fix POBox keyboard issue
Expand for full commit details
Fix POBox keyboard issue
Fix: 373743376
Fix: 329209241
Test: NullableInputConnectionWrapperTest
Change-Id: I94e0e598274fb88b255f977f9fbd50dfbbb1ecb1
Files:
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapperTest.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapper.android.kt
Hash: 57f58c4b80d5d8470b2aca325dfdcd55f235231e
Date: Thu Oct 24 01:25:20 2024
de...@greyarea.no <de...@greyarea.no> #6
Many thanks again for this report. Especially for giving us a huge clue in terms of what could be going wrong. The fix is now merged and I will ask for a cherry-pick into a stable release.
ja...@ntucenterprise.sg <ja...@ntucenterprise.sg> #7
Do you have any concrete plan to cherry-pick the fix into current stable version (1.7.x)? We are currently waiting it.
si...@google.com <si...@google.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
ha...@google.com <ha...@google.com> #9
Thanks for the fix. Sorry to follow up on this. is it possible for you to share specific release version/date for the stable version? We are waiting on this to decide on our direction.
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)