Status Update
Comments
ji...@gmail.com <ji...@gmail.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.
ma...@google.com <ma...@google.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.
ji...@gmail.com <ji...@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.
le...@gmail.com <le...@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
st...@premex.se <st...@premex.se> #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.
[Deleted User] <[Deleted User]> #7
Do you have any concrete plan to cherry-pick the fix into current stable version (1.7.x)? We are currently waiting it.
se...@google.com <se...@google.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
lo...@gmail.com <lo...@gmail.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.
lo...@gmail.com <lo...@gmail.com> #10
This bug is still present in 1.2.0-alpha06.
er...@gmail.com <er...@gmail.com> #11
im...@gmail.com <im...@gmail.com> #12
an...@gmail.com <an...@gmail.com> #13
For Samsung devices
ma...@gmail.com <ma...@gmail.com> #14
st...@gmail.com <st...@gmail.com> #15
We're experiencing this exact crash in production with a stacktrace that does not help us reproduce it locally at all since the stacktrace doesn't mention any of our code at all. But the worst part is that we're explicitly setting the foundation version to 1.1.1, but looking at our transitive dependencies we're pulling the 1.2.0-beta01 which if all the previous testimonies here are to be believed has to be the culprit.
As a temp fix we're thinking of depending strictly
in gradle on foundation 1.1.1. I am not sure if I am misunderstanding something, but if the case is as I am explaining it, how can we avoid such problems in the future?
st...@hedvig.com <st...@hedvig.com> #16
This may be interesting to you too
mx...@gmail.com <mx...@gmail.com> #17
It seems that
I'm also getting this crash in Compose 1.2.0-beta01.
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.java:134)
From KeyCommand.DELETE_NEXT_CHAR
is received, so I came up with the following repro:
import android.view.KeyEvent
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performClick
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class TextFieldTest {
@get:Rule
val rule = createComposeRule()
@Test
fun textFieldCrash() {
rule.setContent {
var text by remember { mutableStateOf("Text") }
BasicTextField(
value = text,
onValueChange = { text = it },
modifier = Modifier.testTag("TextField")
)
}
rule.onNodeWithTag("TextField").performClick()
rule.waitForIdle()
InstrumentationRegistry.getInstrumentation().sendKeyDownUpSync(KeyEvent.KEYCODE_FORWARD_DEL)
}
}
kl...@google.com <kl...@google.com> #18
Reproduced via adb, since I don't have a keyboard with a
adb shell input keyevent 112
Happens whenever the cursor is at the end of the text, even if there's text in the field.
ap...@google.com <ap...@google.com> #19
Branch: androidx-main
commit d782bbdc9e6e64066eb69ab5ea94640ebbfc534c
Author: Zach Klippenstein <klippenstein@google.com>
Date: Sun May 22 09:55:03 2022
Noop when FORWARD_DELETE keycode is sent to the end of a text field.
When a hardware keyboard's forward delete key is pressed (typically
called "delete", not "backspace"), `TextFieldKeyInput` searches for the
next character from the cursor and creates an `EditCommand` to delete
it. This also happens for some software keyboards that have a delete
key, such as Samsung's.
We were not handling the case where the `BreakIterator`'s search for the
next character returns a sentinel indicating the end of the string,
which turned into a negative index and caused the crash.
The fix is to explicitly no-op when no character break is found.
However, the whole bug is not fixed, because the only place I could find
where we manually create an `EditCommand` for this creates a
`DeleteSurroundingTextCommand` and the bug report includes stack traces
for `DeleteSurroundingTextInCodePointsCommand` as well. The only way
such a command is created is if the `InputConnection` is sent one, and I
can't figure out how to trigger that yet.
This change also makes the commands in question throw at init when
passed invalid constructor arguments. While this is technically a
behavior change, this behavior was already broken before and it is
unlikely any external code is instantiating these objects.
Bug:
Test: Manually tested on emulator with adb to simulate keycode, and
on a Samsung tablet/soft keyboard.
Test: Added automated test: ./gradlew :compose:f:f:cDAT
Relnote: "Pressing the forward delete key when the cursor is at the end
of a text field will no longer crash."
Relnote: "`DeleteSurroundingTextCommand` and
`DeleteSurroundingTextInCodePointsCommand` now require their
constructor arguments to be non-negative."
Change-Id: Ica8e66d221137a82ac8aaa59372decab096a6ef6
M compose/ui/ui-text/build.gradle
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextPreparedSelection.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/StringHelpers.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/input/DeleteSurroundingTextCommandTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/EditCommand.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/HardwareKeyboardTest.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/input/DeleteSurroundingTextInCodePointsCommandTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldKeyInput.kt
[Deleted User] <[Deleted User]> #20
de...@gmail.com <de...@gmail.com> #21
az...@gmail.com <az...@gmail.com> #22
You can use onPreviewKeyEvent
to stop the propagation of events that would lead to a crash.
I've added something like this on app using
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.KeyEvent
import androidx.compose.ui.input.key.isAltPressed
import androidx.compose.ui.input.key.isCtrlPressed
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.onPreviewKeyEvent
import androidx.compose.ui.text.input.TextFieldValue
val osProperty: String = System.getProperty("os.name", "unknown")
val isMac = osProperty.startsWith("mac", ignoreCase = true)
@Composable
fun Modifier.applyTextFieldFixes(value: TextFieldValue): Modifier {
return onPreviewKeyEvent { event ->
// Returns true to mark the event as handled and stop its propagation.
when {
// Temporary fix for https://github.com/JetBrains/compose-jb/issues/565.
// To repro, press CTRL/Option+backspace on an empty TextField.
event.isCtrlBackspace() && value.text.isEmpty() -> true
// Temporary fix for https://github.com/JetBrains/compose-jb/issues/2023.
// To repro, simply press the DEL key at the end of the text.
event.key == Key.Delete && value.isCursorAtTheEnd() -> true
else -> false
}
}
}
private fun KeyEvent.isCtrlBackspace() = key == Key.Backspace && (isCtrlPressed || (isMac && isAltPressed))
private fun TextFieldValue.isCursorAtTheEnd(): Boolean {
val hasNoSelection = selection.collapsed
val isCursorAtTheEnd = text.length == selection.end
return hasNoSelection && isCursorAtTheEnd
}
// Usage
OutlinedTextField(
modifier = Modifier.applyTextFieldFixes(yourTextFieldValue),
value = yourTextFieldValue,
[...]
)
sh...@gmail.com <sh...@gmail.com> #23
kl...@google.com <kl...@google.com> #24
1.2.0-beta02 came out before the fix for this was merged. It should be in the latest RC, if not beta03.
kl...@google.com <kl...@google.com>
ha...@gmail.com <ha...@gmail.com> #26
st...@gmail.com <st...@gmail.com> #27
Are you sure you're on a version which has the fix? Which version is it that crashes for you?
ni...@gmail.com <ni...@gmail.com> #28
[Deleted User] <[Deleted User]> #29
sk...@gmail.com <sk...@gmail.com> #30
This is still happening as of Compose 1.4.0. Can't reproduce, but I got this happening in production today for a Galaxy Note 20 Ultra 5G.
im...@gmail.com <im...@gmail.com> #31
compose version : 1.4.3
kotlin_version = '1.8.10'
os: Android 12
device: SM-A125F
device.family: SM-A125F
handled:no
level: fatal
mechanism: UncaughtExceptionHandler
------------------------------------------------------
ava.lang.IllegalArgumentException: end cannot be negative. [start: 76, end: -1]
at androidx.compose.ui.text.TextRangeKt.packWithCheck(TextRange.kt:124)
at androidx.compose.ui.text.TextRangeKt.TextRange(TextRange.kt:37)
at androidx.compose.foundation.text.selection.SelectionAdjustmentKt.ensureAtLeastOneChar(SelectionAdjustment.kt:467)
at androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$CharacterWithWordAccelerate$1.adjust-ZXO7KMw(SelectionAdjustment.kt:210)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegateKt.getTextSelectionInfo-yM0VcXU(MultiWidgetSelectionDelegate.kt:222)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegate.updateSelection-qCDeeow(MultiWidgetSelectionDelegate.kt:94)
at androidx.compose.foundation.text.selection.SelectionManager.updateSelection-3R_-tFg$foundation_release(SelectionManager.kt:755)
at androidx.compose.foundation.text.selection.SelectionManager.updateSelection-RHHTvR4$foundation_release(SelectionManager.kt:710)
at androidx.compose.foundation.text.selection.SelectionManager$handleDragObserver$1.onDrag-k-4lQ0M(SelectionManager.kt:597)
at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesWithObserver$5.invoke-Uv8p0NA(LongPressTextDragObserver.kt:117)
at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesWithObserver$5.invoke(LongPressTextDragObserver.kt:114)
at androidx.compose.foundation.gestures.DragGestureDetectorKt$detectDragGestures$5.invokeSuspend(DragGestureDetector.kt:191)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:566)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:456)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:469)
at androidx.compose.ui.node.BackwardsCompatNode.onPointerEvent-H0pRuoY(BackwardsCompatNode.kt:374)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:314)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:98)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1361)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1307)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1246)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
at android.view.View.dispatchPointerEvent(View.java:15335)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:7815)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7588)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6922)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6979)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6945)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:7143)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6953)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:7200)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6926)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6979)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6945)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6953)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6926)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:10400)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:10248)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:10204)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:10532)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(InputEventReceiver.java)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:239)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:10480)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:10621)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1108)
at android.view.Choreographer.doCallbacks(Choreographer.java:866)
at android.view.Choreographer.doFrame(Choreographer.java:789)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1092)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
bl...@gmail.com <bl...@gmail.com> #32
Still happens all the time in a SelectionContainer
hierarchy over a column. Crashes the app. You'd think this bug should have priority.
androidx.compose:compose-bom:2023.08.00
androidx.compose.material3:material3:material3:1.1.1
androidx.compose.compiler:compiler:1.5.1
java.lang.IllegalArgumentException: start cannot be negative. [start: -1, end: 6]
at androidx.compose.ui.text.TextRangeKt.packWithCheck(TextRange.kt:121)
at androidx.compose.ui.text.TextRangeKt.TextRange(TextRange.kt:37)
at androidx.compose.foundation.text.selection.SelectionAdjustmentKt.ensureAtLeastOneChar(SelectionAdjustment.kt:462)
at androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$CharacterWithWordAccelerate$1.adjust-ZXO7KMw(SelectionAdjustment.kt:210)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegateKt.getTextSelectionInfo-yM0VcXU(MultiWidgetSelectionDelegate.kt:222)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegate.updateSelection-qCDeeow(MultiWidgetSelectionDelegate.kt:94)
at androidx.compose.foundation.text.selection.SelectionManager.updateSelection-3R_-tFg$foundation_release(SelectionManager.kt:755)
at androidx.compose.foundation.text.selection.SelectionManager.updateSelection-RHHTvR4$foundation_release(SelectionManager.kt:710)
at androidx.compose.foundation.text.selection.SelectionManager$handleDragObserver$1.onDrag-k-4lQ0M(SelectionManager.kt:597)
at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesWithObserver$5.invoke-Uv8p0NA(LongPressTextDragObserver.kt:118)
at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesWithObserver$5.invoke(LongPressTextDragObserver.kt:115)
at androidx.compose.foundation.gestures.DragGestureDetectorKt$detectDragGestures$5$2.invoke(DragGestureDetector.kt:194)
at androidx.compose.foundation.gestures.DragGestureDetectorKt$detectDragGestures$5$2.invoke(DragGestureDetector.kt:193)
at androidx.compose.foundation.gestures.DragGestureDetectorKt.drag-jO51t88(DragGestureDetector.kt:115)
at androidx.compose.foundation.gestures.DragGestureDetectorKt$drag$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:179)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:168)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:474)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:508)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:497)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:368)
at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:665)
at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl.dispatchPointerEvent(SuspendingPointerInputFilter.kt:544)
at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:566)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:317)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:96)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1446)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1398)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1338)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.View.dispatchPointerEvent(View.java:14858)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6446)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6247)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5725)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5913)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5970)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8696)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8647)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8616)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8819)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:239)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:8776)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:8905)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1037)
at android.view.Choreographer.doCallbacks(Choreographer.java:845)
at android.view.Choreographer.doFrame(Choreographer.java:772)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@23a716e, androidx.compose.runtime.BroadcastFrameClock@a86000f, StandaloneCoroutine{Cancelling}@9acc89c, AndroidUiDispatcher@85922a5]
gr...@google.com <gr...@google.com> #33
see
Description
Android Studio Build:30
Kotlin version:1.5.21
Steps to Reproduce:
1. when the textField is empty, cilck backSpace, then crash
Process: com.example.compose.jetchat, PID: 20258
java.lang.IllegalArgumentException: start cannot be negative. [start: -1]
at androidx.compose.ui.text.TextRangeKt.packWithCheck(TextRange.kt:121)
at androidx.compose.ui.text.TextRangeKt.TextRange(TextRange.kt:37)
at androidx.compose.ui.text.input.EditingBuffer.delete$ui_text_release(EditingBuffer.kt:190)
at androidx.compose.ui.text.input.DeleteSurroundingTextInCodePointsCommand.applyTo(EditCommand.kt:354)
at androidx.compose.ui.text.input.EditProcessor.apply(EditProcessor.kt:93)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.onEditCommand(TextFieldDelegate.kt:198)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.access$onEditCommand(TextFieldDelegate.kt:90)
at androidx.compose.foundation.text.TextFieldDelegate$Companion$restartInput$1.invoke(TextFieldDelegate.kt:246)
at androidx.compose.foundation.text.TextFieldDelegate$Companion$restartInput$1.invoke(TextFieldDelegate.kt:246)
at androidx.compose.ui.text.input.TextInputServiceAndroid$createInputConnection$1.onEditCommands(TextInputServiceAndroid.android.kt:111)
at androidx.compose.ui.text.input.RecordingInputConnection.endBatchEditInternal(RecordingInputConnection.android.kt:162)
at androidx.compose.ui.text.input.RecordingInputConnection.addEditCommandWithBatch(RecordingInputConnection.android.kt:136)
at androidx.compose.ui.text.input.RecordingInputConnection.deleteSurroundingTextInCodePoints(RecordingInputConnection.android.kt:202)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:464)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:85)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)