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

Array index is out of range. on project build and run

Discussion in 'Editor & General Support' started by SamohtVII, Sep 1, 2018.

  1. SamohtVII

    SamohtVII

    Joined:
    Jun 30, 2014
    Posts:
    368
    Can someone please help me find out why my game is all of a sudden giving me this error....


    IndexOutOfRangeException: Array index is out of range.
    UnityEditor.Android.AndroidBuildWindowExtension.GetBuildPlayerWindow ()
    UnityEditor.Android.AndroidBuildWindowExtension.RepaintTargetList ()
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:191)


    I "Build and Run" my game which has 3 scenes with indexes 0, 1 and 2 and it gets to the very last part of building where it tries to put it on my phone (Android Game) but then fails and seems to not do anything.

    The file in questions (EditorApplication.cs:191) says this


    static void Internal_CallUpdateFunctions()
    {
    if (update != null)
    update();
    }


    Whcih doesn't really help but anyway.

    Can someone please help.
    If it matters I added a new scene and renamed an existing scene since last successful build.
    The game also tests fine in the editor.

    Thanks
     
  2. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    Should "update" be capitalised as "Update"?
     
  3. SamohtVII

    SamohtVII

    Joined:
    Jun 30, 2014
    Posts:
    368
    I managed to correct this by exporting my APK to a different drive on my PC. Not sure what happened but I think I had permission issues.

    Thanks anyway.
     
    KING_REX_95 and eLHite like this.
  4. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Is that the entire callstack? It looks like a bug in Unity.

    Sam
     
  5. uitel2

    uitel2

    Joined:
    Oct 23, 2017
    Posts:
    7
    I have the same problem
     
  6. chitvanbhutani8

    chitvanbhutani8

    Joined:
    Feb 8, 2019
    Posts:
    1
    IndexOutOfRangeException: Index was outside the bounds of the array.
    UnityEditor.Android.AndroidBuildWindowExtension.GetBuildPlayerWindow () (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.AndroidBuildWindowExtension.RepaintTargetList () (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:200)

    I got this error ...can anybody help??
     
  7. gcjunior

    gcjunior

    Joined:
    Mar 26, 2019
    Posts:
    3
    Hi there,

    I had the same issue and the fix was to create the project in a different folder. It might be permission issues in your windows file system. You should try to save your project into C:\Unity3D-AR or something like in this folder.
     
  8. onad13

    onad13

    Joined:
    Aug 5, 2019
    Posts:
    1

    it worked ,thank you so much bro :)
     
  9. KingKong320

    KingKong320

    Joined:
    Mar 2, 2018
    Posts:
    21
    You can try going to Build Settings [in File->Build Settings or hit (Ctrl+Shift+B)] and click Player Settings (Also can be accessed from Edit->Project Settings-> Player) and in the Inspector window select Other Settings. Under Rendering see if the following options are checked:

    • Auto Graphics API

    • Multithreaded Rendering

    • Static Batching

    • Dynamic Batching

    • Lightmap Streaming Enabled
    And that's is.
     
  10. Machlou_Med

    Machlou_Med

    Joined:
    Sep 19, 2019
    Posts:
    1
    thanks you it s working