- Home /
iOS crash while selecting text within an InputFied
Hello everyone.
Just having a consistent crash in iOS (iPhone) built with Unity 2019.3.9f1
Repro steps:
Tap on an InputField (Touchkeyboard shows up)
Type something
Try selecting the entire text or just a letter by touching/holding/dragging over the InputField
This is the crash message:
ArgumentOutOfRangeException: Selection is out of range.
Parameter name: selection
at UnityEngine.TouchScreenKeyboard.set_selection (UnityEngine.RangeInt value) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.UI.InputField.LateUpdate () [0x00000] in <00000000000000000000000000000000>:0
UnityEngine.UnhandledExceptionHandler:PrintException(String, Exception)
UnityEngine.UnhandledExceptionHandler:HandleUnhandledException(Object, UnhandledExceptionEventArgs)
System.UnhandledExceptionEventHandler:Invoke(Object, UnhandledExceptionEventArgs)
(Filename: currently not available on il2cpp Line: -1)
I read about a similar crash while using TMP here:
But I'm using UnityEngine.UI.InputField and not TMP.
I am using the InputField property Hide Mobile Input = true
The crash only happens in an iOS device, not in the Editor
Any help would be useful, thanks!
I am also getting a lot of this crash in Unity Analytics, I am also using UnityEngine.UI.InputField and not T$$anonymous$$P, in Unity 2019.3.11f1. But all my crashes are on Android. Did you find any solution? Please let me know.
Answer by Sailendu · May 04, 2020 at 12:18 PM
I found a temporary solution after posting the comment earlier. The crash does not happen if the "Hide Mobile Input" property is set to false in the InputField's inspector. An additional native input text shows up above the keyboard when this is set to false, but at least the crash does not happen. I tested it in Android, have not tested in iOS yet. I am settings all my input field's Hide Mobile Input to false until the bug is fixed. Hope this helps.