Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ArgumentOutOfRangeException with no line references

Discussion in 'Android' started by ina, Feb 1, 2012.

  1. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,080
    For some reason, I receive the following errors when I try to build to Android. I am able to run this with no errors in the editor, though (and through Unity Remote). No idea where to start fixing this, as there are no line numbers referenced at all..


    Error building Player: ArgumentOutOfRangeException: Index is less than 0 or more than or equal to the list count.
    Parameter name: index
    0
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()



    Exception: Error building Player: ArgumentOutOfRangeException: Index is less than 0 or more than or equal to the list count.
    Parameter name: index
    0
    UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions)
    UnityEditor.BuildPlayerWindow.BuildPlayerAndRun ()
     
  2. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,080
    Apparently this was due to how I had a dictionary as a parameter in one of the functions, without explicitly setting the key/value

    Code (csharp):
    1.  
    2. i.e. function blah(dic:Dictionary) instead of function blah(dictionary:Dictionary.<String,String>)
    3.  
    This took a lot of head banging and copy/cutting code out to see what was wrong. I wonder if there is a better methodology for debugging?