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

Build was a 'success' but several errors that didn't appear in Editor - I'm stumped.

Discussion in 'Getting Started' started by mangapinches, Sep 3, 2019.

  1. mangapinches

    mangapinches

    Joined:
    Apr 2, 2019
    Posts:
    12
    I built a project on Windows to export for a game design class.

    Strangely, despite building as a 'success' several areas of the game broke immediately: character wouldn't move, stamina bar was set to empty...all these features worked in the editor.

    I have no idea why there is a discrepancy between the editor and the build. I only have one scene, I checked tags for 'editor only,' and...I'm out of ideas.

    Any possible fixes? Any help appreciated.
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
  3. mangapinches

    mangapinches

    Joined:
    Apr 2, 2019
    Posts:
    12
    Thanks - I found this player.log but having trouble making sense of it. Most of the lines of code mentioned are when I Debug.Log("Tell something.")...Do I have to remove Debug.Log() from the code when I export it?

    UnloadTime: 0.699807 ms
    Your maxStamina is 0
    UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    Stamina:.ctor() (at C:\Users\Jonathan\Documents\Creative\Game Design\My Neighborhood Dungeon\Assets\Scripts\UI\StaminaBar.cs:40)
    StaminaBar:Awake() (at C:\Users\Jonathan\Documents\Creative\Game Design\My Neighborhood Dungeon\Assets\Scripts\UI\StaminaBar.cs:15)
    (Filename: C:/Users/Jonathan/Documents/Creative/Game Design/My Neighborhood Dungeon/Assets/Scripts/UI/StaminaBar.cs Line: 40)
    AudioSource component missing from this gameobject. Adding one.
    UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:LogWarning(Object)
    CharacterController2D:Awake() (at C:\Users\Jonathan\Documents\Creative\Game Design\My Neighborhood Dungeon\Assets\Scripts\CharacterController2D.cs:96)
    (Filename: C:/Users/Jonathan/Documents/Creative/Game Design/My Neighborhood Dungeon/Assets/Scripts/CharacterController2D.cs Line: 96)
    You are exhausted!
    UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    Stamina:Update() (at C:\Users\Jonathan\Documents\Creative\Game Design\My Neighborhood Dungeon\Assets\Scripts\UI\StaminaBar.cs:53)
    StaminaBar:Update() (at C:\Users\Jonathan\Documents\Creative\Game Design\My Neighborhood Dungeon\Assets\Scripts\UI\StaminaBar.cs:20)
    (Filename: C:/Users/Jonathan/Documents/Creative/Game Design/My Neighborhood Dungeon/Assets/Scripts/UI/StaminaBar.cs Line: 53)
    Setting up 4 worker threads for Enlighten.
    Thread -> id: 6edc -> priority: 1
    Thread -> id: 3990 -> priority: 1
    Thread -> id: 6438 -> priority: 1
    Thread -> id: 6de0 -> priority: 1
    ##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1567493001392,"processId":25324,"allocatedMemory":54063,"memoryLabels":[{"Default":1048},{"NewDelete":236},{"Thread":-184},{"Manager":320},{"VertexData":9456},{"GfxDevice":7408},{"Audio":192},{"Physics":32},{"Serialization":40},{"Terrain":88},{"String":1819},{"DynamicArray":480},{"PoolAlloc":-88},{"Sprites":31920},{"VR":1288},{"Secure":8}]}
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    no need to remove those.. i don't see any error messages on this log, is that the full log?

    are you loading some files using file system? (in that case path might have changed in build?)

    you could try adding some debug logs on those parts where it has issues,
    like movement when joystick or key is pressed (to see that those are getting called), and when settings stamina bar value etc.
     
    Joe-Censored likes this.
  5. mangapinches

    mangapinches

    Joined:
    Apr 2, 2019
    Posts:
    12
    I cut out the beginning part - I'll paste it here so it's the full log.

    What's interesting is that after building, when I playtest in the editor the game seems to have reverted so the editor now has the same errors as the build. Then I reopen the project and everything is fine.

    I'm not sure how to use the file system...but it does seem like things are being built out of order or something. Do you recommend trying Development Build or Script Debugging checkboxes when building?


    Mono path[0] = 'C:/Users/Jonathan/Desktop/Distributionfolder/Distributionfolder/MND_Builds/2019_SEP_3/My Neighborhood Dungeon_Data/Managed'
    Mono config path = 'C:/Users/Jonathan/Desktop/Distributionfolder/Distributionfolder/MND_Builds/2019_SEP_3/MonoBleedingEdge/etc'
    PlayerConnection initialized from C:/Users/Jonathan/Desktop/Distributionfolder/Distributionfolder/MND_Builds/2019_SEP_3/My Neighborhood Dungeon_Data (debug = 0)
    PlayerConnection initialized network socket : 0.0.0.0 55349
    Multi-casting "[IP] [Flags] 2 [Guid] 2572821954 [EditorId] 2966583153 [Version] 1048832 [Id] WindowsPlayer(LAPTOP-O5) [Debug] 0 [PackageName] WindowsPlayer" to [225.0.0.222:54997]...
    Started listening to [0.0.0.0:55349]
    PlayerConnection already initialized - listening to [0.0.0.0:55349]
    Initialize engine version: 2019.2.0f1 (20c1667945cf)
    [XR] Discovering subsystems at path C:/Users/Jonathan/Desktop/Distributionfolder/Distributionfolder/MND_Builds/2019_SEP_3/My Neighborhood Dungeon_Data/UnitySubsystems
    GfxDevice: creating device client; threaded=1
    Direct3D:
    Version: Direct3D 11.0 [level 11.1]
    Renderer: NVIDIA GeForce GTX 1060 (ID=0x1c20)
    Vendor:
    VRAM: 6052 MB
    Driver: 26.21.14.3602
    Begin MonoManager ReloadAssembly
    - Completed reload, in 0.091 seconds
    <RI> Initializing input.
    <RI> Input initialized.
    <RI> Initialized touch support.
    UnloadTime: 0.699807 ms
     
  6. mangapinches

    mangapinches

    Joined:
    Apr 2, 2019
    Posts:
    12
    I solved the problem!

    I searched online and reflected on what was being broken - one of my scripts grabs a reference from another in Awake(). That was the empty stamina value of 0.

    So I switched that to Start() and now it's properly able to grab the stamina value and thus the character can move again.

    Thank you so much for all your help! The player.log really helped me to zero in on the problem.
     
    hopeful likes this.