Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

InputField ArgumentOutOfRangeException

Discussion in 'UGUI & TextMesh Pro' started by giano574, Feb 4, 2015.

  1. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    Hi! I can confirm that the error still exists in Unity 2020.3.21.
    According to analytics, 0.43% of my users have faced this issue on Android, I see ~1000 events per month (the app has ~100K installs per month).
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    TMP Input Field or UI Input Field?
     
  3. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    UI Input Field
     
  4. cuikeqiang

    cuikeqiang

    Joined:
    Nov 16, 2019
    Posts:
    5
    Did you use Unity new Input System??
    I used new Input System and found same problem.
     
  5. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    No, I'm still on the old one.
     
  6. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    @Stephan_B Hello! Any updates on this? The error still exists. Should I create a bug maybe? I could, but I'm sure they will say "can't reproduce". What can we do to pay your team attention on this bug?
     
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I have run / fixed a few of those but would love to have a bug report with project and steps to verify the fixes do resolve the issue for you.
     
  8. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    I can't reproduce it, but as I said, it happens on user devices and I can only see errors in analytics. I could publish an update for my app to check if it still exist, but I should know the Unity version where it was probably fixed.
     
    epernigo likes this.
  9. grrava

    grrava

    Joined:
    Nov 11, 2012
    Posts:
    36
    I have this issue as well, I see it happen only with korean users:

    HPTM  Crash and Exception Reporting - Cloud Diagnostics  Unity Gaming Services — Mozilla Firefox.jpg

    I've added the json so you can analyze.
     

    Attached Files:

  10. BillionaireGames

    BillionaireGames

    Joined:
    Dec 11, 2019
    Posts:
    1
    It also happens on 2020.3.24f1.


    ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
    Parameter name: startIndex
    System.String.Substring (System.Int32 startIndex, System.Int32 length) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    UnityEngine.UI.InputField.Append (System.Char input) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/InputField.cs:2299)
    UnityEngine.UI.InputField.KeyPressed (UnityEngine.Event evt) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/InputField.cs:1840)
    UnityEngine.UI.InputField.OnUpdateSelected (UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/InputField.cs:1894)
    UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IUpdateSelectedHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:99)
    UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:262)
    UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)
     
  11. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    This appears to be happening with the UGUI Input Field and not the TMP Input Field. I would suggest you submit a bug report with project if you are able to reliably reproduce this issue.
     
  12. lazylukey

    lazylukey

    Joined:
    May 26, 2017
    Posts:
    35
    Hi we've seen this across a reasonable number of users in DEVOUR on both Unity 2019 and Unity 2020 builds, for us its entirely either Chinese or Japanese users and we've pinned it down to a decimal number input field with a max length of 4 characters. We do not yet have a reliable reproduction method
     
    Last edited: Mar 27, 2022
  13. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Which input field are you using? TMP or UGUI?

    If TMP please be sure to test with version 2.2.0-preview.3 for Unity 2019.4 or version 3.2.0-pre.3 for Unity 2020.3 or newer as I have made changes to the input field to address some potential Index Out of Range exception errors.
     
  14. lazylukey

    lazylukey

    Joined:
    May 26, 2017
    Posts:
    35
    Hi, we're using UGUI on 2020.3.29f1
     
    epernigo likes this.
  15. Pyr3z

    Pyr3z

    Joined:
    Jul 6, 2017
    Posts:
    32
    Us too~
    • 2020.3.48
    • Android (anywhere between API 19-33)
    • UGUI
    • Input Manager
    • InputField::shouldHideMobileInput = false
    • Single Line, Standard Input, Default Keyboard, Alphanumeric Validation
    • Not easy to reproduce, but 2-3k occurrences per week makes it one of our top NFEs
     
    Last edited: Aug 3, 2023
  16. Pyr3z

    Pyr3z

    Joined:
    Jul 6, 2017
    Posts:
    32
    When can we pull/merge request UGUI? o_O
     

    Attached Files:

    lowLevell likes this.