Crash when picking auto completion in UI and backspacing
See original GitHub issueSteps to reproduce
- Open a group chat on Messenger app
- Write
@
- Select someone from Messenger suggestion (it writes
@firstname lastname
into the textbox) - Press backspace twice (deleting space, then lastname)
- Write
,
(the keyboard insert its first suggestion then comma (I get@firstnamelastname,
) - Delete until the end of firstname (
@firstname
) - Write
,
(for some reason, it removes everything in the box but the comma) - Press backspace to remove the comma
- Firstname reappears, but is no more linked
- Click on Messenger name link suggestion
- The textbox is like in step 3, but an extra empty char at the end, all underlined and the keyboard crashes
Actual behaviour
The keyboard crashed
Hi. It seems that we have crashed.... Here are some details:
****** UTC Time: 09:45:53 02.07.2021
****** Application name: AnySoftKeyboard (com.menny.android.anysoftkeyboard) v1.10.1786 release 6956. Installed on 1621131107691, first release installed was 5539.
******************************
****** Exception type: java.lang.StringIndexOutOfBoundsException
****** Exception message: length=4; regionStart=0; regionLength=16
****** Trace trace:
at java.lang.AbstractStringBuilder.startEndAndLength(AbstractStringBuilder.java:211)
at java.lang.AbstractStringBuilder.codePointCount(AbstractStringBuilder.java:858)
at java.lang.StringBuilder.codePointCount(StringBuilder.java:44)
at b.b.v.t0.d()
at com.anysoftkeyboard.AnySoftKeyboard.f(:2)
at com.anysoftkeyboard.AnySoftKeyboard.a(:27)
at com.anysoftkeyboard.AnySoftKeyboard.a(:48)
at com.anysoftkeyboard.saywhat.PublicNotices.a()
at b.b.z.r0.y0.a(:2)
at b.b.z.r0.y0.d()
at com.anysoftkeyboard.keyboards.views.AnyKeyboardViewBase.a(:13)
at com.anysoftkeyboard.keyboards.views.AnyKeyboardViewBase.a()
at com.anysoftkeyboard.keyboards.views.AnyKeyboardViewBase.onTouchEvent(:23)
at b.b.z.r0.g0.onTouchEvent()
at com.anysoftkeyboard.keyboards.views.AnyKeyboardView.onTouchEvent(:5)
at android.view.View.dispatchTouchEvent(View.java:9390)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2461)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1777)
at android.app.Dialog.dispatchTouchEvent(Dialog.java:833)
at android.inputmethodservice.SoftInputWindow.dispatchTouchEvent(SoftInputWindow.java:93)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2422)
at android.view.View.dispatchPointerEvent(View.java:9610)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4447)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4313)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3847)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3900)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3866)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3992)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3874)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4049)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3847)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3900)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3866)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3874)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3847)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6146)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6120)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6081)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6262)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:192)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:330)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5621)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
******************************
****** Device information:
BRAND:HONOR
DEVICE:HWPLK
Build ID:PLK-L01C432B397
changelist number:HONORPLK-L01
MODEL:PLK-L01
PRODUCT:PLK-L01
TAGS:release-keys
VERSION.INCREMENTAL:C432B397
VERSION.RELEASE:6.0
VERSION.SDK_INT:23
Locale:en_IE
configuration:{1.0 206mcc30mnc en_IE ldltr sw360dp w360dp h580dp 480dpi nrml port finger -keyb/v/h -nav/h suim:1 s.59}
That's all I know.******************************
****** Log-Cat:
Log contains 0 lines:
Android OS version: 6 Device manufacturer and model: Honor 7 List of installed add-ons (like languages, or themes): French add-on
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
crash when making selection in AutoCompleteTextView
I am selecting from my contacts list. Whenever I make a selection, I get the following error: java.lang.IllegalArgumentException: Invalid ...
Read more >xcode 7 crashes on autocompletion NSRangeException
I get this crash each time Xcode uses autocompletion. Steps -. 1. Use any system library - Ex.: UIColor. 2. I type "[UIColor...
Read more >Cypress slows down and then crashes during cypress run
I'll run a test manually, using the UI. It's a coin-flip whether it freezes or runs smoothly. It will usually freeze when the...
Read more >It is time to unlink the "Backspace" -> Browser Back shortcut.
I am aware that while typing in a field (like this one) the backspace button will delete letters and not move the browser...
Read more >Crash when selecting preferred weapon : r/Nioh - Reddit
Nioh: Complete Edition (PC) - Crash when selecting preferred weapon. I managed to beat the tutorial level, but now when it asks me...
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
The same crash happened to me on version v1.11-r1, is there a fix to this bug? Thank you.
Got a new reproducer:
@firstname lastname
into the textbox), with an extra empty char, all underlined (like step 11)When pressing backspace, the code goes to https://github.com/AnySoftKeyboard/AnySoftKeyboard/blob/0b6307626befdb09d87509d7a78876b0dfdca6b4/ime/dictionaries/src/main/java/com/anysoftkeyboard/dictionaries/WordComposer.java#L283
mCursorPosition
has been updated from https://github.com/AnySoftKeyboard/AnySoftKeyboard/blob/0b6307626befdb09d87509d7a78876b0dfdca6b4/ime/app/src/main/java/com/anysoftkeyboard/ime/AnySoftKeyboardSuggestions.java#L470 which pushes themCursorPosition
to the end of@firstname lastname
, without modifyingmTypedWord
(which still contains the word that has been typed by the user, not the resulting word from Messenger suggestion). So, you end up trying to manipulate amTypedWord
which is shorter than themCursorPosition
.Logcat