IllegalArgumentException: end cannot negative. [end: -1]
See original GitHub issueI have the following crash in production. The stacktrace doesn’t refer to my code in any place and unfortunatelly I’m not able to reproduce it.
Besides everything else - there’s missing “be” in the exception message.
Fatal Exception: java.lang.IllegalArgumentException: end cannot negative. [end: -1]
at androidx.compose.ui.text.TextRangeKt.packWithCheck(TextRangeKt.java:124)
at androidx.compose.ui.text.TextRangeKt.TextRange(TextRangeKt.java:37)
at androidx.compose.ui.text.input.EditingBuffer.delete$ui_text_release(EditingBuffer.kt:205)
at androidx.compose.ui.text.input.DeleteSurroundingTextCommand.applyTo(EditCommand.kt:271)
at androidx.compose.ui.text.input.EditProcessor.apply(EditProcessor.java:110)
at androidx.compose.foundation.text.TextFieldKeyInput.apply(TextFieldKeyInput.kt:62)
at androidx.compose.foundation.text.TextFieldKeyInput.access$apply(TextFieldKeyInput.java:49)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:134)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:102)
at androidx.compose.foundation.text.TextFieldKeyInput.commandExecutionContext(TextFieldKeyInput.java:211)
at androidx.compose.foundation.text.TextFieldKeyInput.process-ZmokQxo(TextFieldKeyInput.java:102)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke-ZmokQxo(TextFieldKeyInput.kt:243)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke(TextFieldKeyInput.kt:243)
at androidx.compose.ui.node.ModifiedKeyInputNode.propagateKeyEvent-ZmokQxo(ModifiedKeyInputNode.kt:47)
at androidx.compose.ui.input.key.KeyInputModifier.processKeyInput-ZmokQxo(KeyInputModifier.java:78)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent-ZmokQxo(AndroidComposeView.android.kt:562)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:569)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1986)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1986)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1986)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1986)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:946)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1947)
at android.app.Activity.dispatchKeyEvent(Activity.java:4147)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:800)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:7490)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7316)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6709)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6766)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6732)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6911)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6740)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6968)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6713)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6766)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6732)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6740)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6713)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:10001)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:9839)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:9792)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:6313)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:247)
at android.app.ActivityThread.main(ActivityThread.java:8656)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:7 (1 by maintainers)
Top Results From Across the Web
When delete key pressed: java.lang.IllegalArgumentException ...
the cursor was at the end of the textfield. suddenly the app crashed. Error java.lang.IllegalArgumentException: end cannot negative. [end: -1].
Read more >Crash Issue: java.lang.IllegalArgumentException: end cannot ...
1.Crash reported only during the play store app upload validation by google. ... IllegalArgumentException: end cannot negative. [end: -1]
Read more >PrecomputedText - Android Developers
IllegalArgumentException, if start and end offset are in the different paragraph. ... FontMetricsInt: the output font metrics This value cannot be null ....
Read more >leftalignindels: java.lang.IllegalArgumentException: the range ...
IllegalArgumentException : the range cannot contain negative indices ... and we want to look at this on our end to find the specific...
Read more >How to solve an IllegalArgumentException in Java?
When Arguments out of range. For example, the percentage should lie between 1 to 100. · When argument format is invalid. · When...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue is reproducible on Samsung devices while pressing “DEL” key from keyboard, It will crash along with above crash logs. I’m also facing same issue.
The version I use is v1.2.0-alpha04