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. Dismiss Notice

Bug 2022.02.0b9 Asset has disappeared while building player to 'globalgamemanagers.assets'

Discussion in '2022.2 Beta' started by StefanWo, Oct 1, 2022.

  1. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    When i start a build like normal, it shows me the following error.

    Asset has disappeared while building player to 'globalgamemanagers.assets' - path '', instancedID '-43676'
    UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions)


    WORKAROUND: After some search, i found some bugs from several years ago, showing a workaround: Close all Unity Windows, Restart Unity, directly start the compile without opening windows. => Worked... But not very useful :)

    Just opening the console brings that error again, so another restart is needed..

    ps.: Same at 2022.02.0b8 and 2022.02.0b9.
     
  2. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,494
    I've had files disappear due to antivirus quarantine - solution for me was whitelisting engine and project folders. If doesn't help in your case, maybe helps someone else. I'm using 2022.2.0b9 as well but have had no such issue (so far).
     
  3. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    No antivirus in use here. Also why its working when unity starts with closed unity-tabs and directly the build is started :) So i think, it has to do something with unity itself.
     
    Last edited: Oct 1, 2022
  4. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    Update: I Nailed it down to Console, Game and Scene Window. They has to be never opened, to prevent this error.
     
    jonas-thefullyarcade likes this.
  5. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    979
    I have same issue. Unity 2022.2.0b11 still has this issue.
    Windows : OK
    Mac Intel : Error
    Mac M1 : Error
    So I can't build iOS player :(
     
  6. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    236
    Same for me on 2022.2.0b15. It happens sometimes, but not always; usually it suffices to try building again.
     
  7. Mic_Emond

    Mic_Emond

    Joined:
    Nov 16, 2016
    Posts:
    44
    We were getting the same, ever since 2022.2 beta.
    Waited out for the official 2022.2.0f1 release, but still getting the same.

    So +1 on this.
    It's preventing us from upgrading to the new tech stack. Which we want for Entities 1.0 and other editor ameliorations
    Anyone managed to fix this ?
     
  8. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    I also still got that error also with the 2022.2.0f1.
    @Mic_Emond: My workaround i mentioned in the first post is still working for me. Sometimes i need to restart one more time. Its pretty annoying, due to the compile took a very long time and it just crashes at the end of it...

    The Forum has been moved to achived now...
    Is anyone from Unity that have this bug noticed?

    Update: Looks like in Unity 2023.1.0a22 it seems not happening, but that editor crashes way too often for other reasons...
     
    Last edited: Dec 13, 2022
  9. Mic_Emond

    Mic_Emond

    Joined:
    Nov 16, 2016
    Posts:
    44
    @StefanWo Thanks for the confirmation.
    Sadly we're using a build machine and running builds through the command line and they still fail. (they also fail when trying from the editor locally)
    I've started a new thread in the "Editor" part of the forum since 2022.2 is out of beta now. But it's quickly getting burried.
    (here it is for anyone interested)
    https://forum.unity.com/threads/build-fails-after-update-to-2022-2-0f1.1373190/

    Going to 2023 isn't a good move for us as we'd like to ship within the 2022 LTS cycle
     
    StefanWo likes this.
  10. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    Thanks for posting it there too. I discovered some other forum entries, related to the UI-Package, that would make sens, that not using it in the editor fixes this issue somehow. In the new Version i had troubles even when i tried to do that, and it worked even with all windows open. Its really strange...

    I could fix it from time to time when playing around with packages, so adding and removing them. Than directly after the restart of the Editor, i can build it once without that error. It's also mentioned here as a workaround:
    https://forum.unity.com/threads/dot...ets-is-corrupted-in-standalone-build.1031437/

    Update: After its compiled, i get strange memory corruptions, maybe its related to it, maybe not. I have to downgrade again to Entities 0.51 to continue working... Hope this errors got fixed soon :(
     
    Last edited: Dec 14, 2022
  11. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    New Entities prev-44 with the recommended Unity version => still the same. But after compiling a 2. time it worked. No idea...

    I can't just remove the entities, due to i build my project on it.
     
  12. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    Using pre-65 and Unity 2022.2.13 => still the same... Anyone an idea what can be the cause of this strange bug, or ideas how to figure this out?
     
  13. stevemcilwain

    stevemcilwain

    Joined:
    Feb 21, 2021
    Posts:
    2
    Same bug here, Unity 2022.2.14f1... show stopper.
     
  14. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    Good to hear, that i'm not the only one :)

    I'm now on Unity 2022.2.16 and got once an additional other error: (the original one still appears when trying to build again)

    Code (CSharp):
    1. Building - Failed to write file: resources.assets
    Is this maybe somehow related?
     
  15. sinedsem

    sinedsem

    Joined:
    May 7, 2020
    Posts:
    7
    Same here with Unity 2022.2.19f1 and WebGL build.
     
  16. HECer

    HECer

    Joined:
    Mar 17, 2013
    Posts:
    46
    Same here with Unity 2022.2.21 building for Android:

    Asset has disappeared while building player to 'globalgamemanagers.assets' - path '', instancedID '-128600'
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
  17. rainwizerd

    rainwizerd

    Joined:
    Feb 19, 2020
    Posts:
    7
    Same bug on 2023.3.0 lts, can we get a Unity employee in here to help resolve? Pretty disruptive and unexpected in an lts release...
     
  18. AndrewSkow

    AndrewSkow

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    78
    Hi! I've done some searching in our bug tracking and conversation history and it seems we do not have a bug that has repro steps that we can use to search for any bug inside unity. And there has been various efforts to find a response for this thread, but it seems no one was able to come up with something definite. So rather than leaving things silent I can at least give a little info of what we know.

    The GlobalGameManagers are singletons that encompass a lot of settings like Graphics Settings, Player Settings, Quality Settings, etc. E.g. This is info that is needed at Runtime as well as the Editor, but not associated with individual scenes.

    1 Player builds start by collecting the dependencies of the GlobalGameManagers.
    2 All the Scenes and Resources are built
    3 Finally the GlobalGameManager information is stripped down based on what is actually needed and the GlobalGameManager.asset is written.

    The issue is that at step 2 a lot Script code can execute, e.g. from build callbacks, from Awake() calls as the scenes are loaded etc. This can include code that is part of packages.

    The error is logged at step 3, and it indicates that some dependency that was accumulated in step 1 has gone missing, e.g. something destroyed an object in an unexpected way between step 1 and 3.

    Unfortunately the file path is empty and the instanceID is negative, which means that it the missing object has not been loaded from a file - it was created in memory. So there not enough error information from that message to pinpoint what data is involved.

    I know some comments here mention possibly of a source control or anti-virus cause. That may make sense and certainly worth considering. But for those cases of actual file system problems I would expect a non-empty path in the error message.

    Sorry I don't have a solution to suggestion, but I hope that explanation of what sort of problem can cause that error can possibly be helpful!
     
  19. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    I submitted IN-44206 case number for u to investigate this build error.
     
    AndrewSkow likes this.
  20. weareroyale

    weareroyale

    Joined:
    Oct 23, 2014
    Posts:
    4
    We are seeing this bug in Unity 2019.4.28f1 while building to iOS, in a project that previously built fine in 2019.4.12f1.
     
  21. TMThomsen

    TMThomsen

    Joined:
    Oct 27, 2018
    Posts:
    1
    We're seeing the same issue in version 2022.3.0.

    If the editor has been open for some time, the build process fails, but if you close and reopen Unity, the build always works. I have no idea what causes it.
     
    Unifikation likes this.
  22. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,043
    I got as far as 2019.4.16f

    2019.4.17f and up seem to be the start of this problem. For me.... on a Mac, using Builtin, for iOS builds.
     
  23. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,043
    How about using some reasoning, insight and inquisitiveness into what and hows that could be causing this?
     
  24. travis-TAP-3D

    travis-TAP-3D

    Joined:
    Sep 12, 2022
    Posts:
    17
    This is still occurring for me as of 2022.3.5f1 fwiw. If I close the editor and build again its fine but that's a hacky workaround. (WebGL builds)
     
  25. AndrewSkow

    AndrewSkow

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    78
    levoxtrip and optimise like this.
  26. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    :eek: Currently at latest 2022.3.6f1 my project when trying to build player runtime sometimes will get another weird fatal error that tells me splash screen cache at Library is missing and then crash.
     
    Last edited: Aug 3, 2023
  27. kostya_lutsuk

    kostya_lutsuk

    Joined:
    Dec 18, 2020
    Posts:
    3
    We have the same error while building standalone. Android and iOS don't have this problem.

    Asset has disappeared while building player to 'globalgamemanagers.assets' - path '', instancedID '-379362'
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
  28. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    The raise of this bug getting now more and more random. It seems for me it helps just to retry over and over again, till its working. Sometimes it need 5 tries to finish successfully. Sometimes its failing directly after another build for another platform was successful.

    For everyone who also have a custom build script, here my quick dirty "workaround":

    Code (CSharp):
    1.  
    2.        var unityBugAppeared = false;
    3.         Application.LogCallback onLogMessage = (string condition, string stackTrace, LogType type) => {
    4.             if (type == LogType.Error && condition.Contains("globalgamemanagers.assets")) {
    5.                 Debug.Log("Detected Unity bug. Marking for retry");
    6.                 unityBugAppeared = true;
    7.             }
    8.         };
    9.         Application.logMessageReceived += onLogMessage;
    10.         Application.logMessageReceivedThreaded += onLogMessage;
    11.         UnityEditor.Build.Reporting.BuildReport report;
    12.         try {
    13.             report = BuildPipeline.BuildPlayer(options);
    14.         } finally {
    15.             Application.logMessageReceived -= onLogMessage;
    16.             Application.logMessageReceivedThreaded -= onLogMessage;
    17.         }
    18.  
     
  29. AndrewSkow

    AndrewSkow

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    78
    I've got a bit more specific advice from another Unity developer which may be a helpful follow up to my earlier posts:

    This error typically means that, during a callback or event, some script is destroying an object that is referenced by one of the singletons (Graphics Settings, Quality Settings, Project Settings, etc) that are stored in globalgamemanagers.assets.

    A good place to look for problematic code is in any usage of the attributes [ExecuteAlways] or [ExecuteInEditMode].
    Those will also be triggered during the build, as the scenes and assets are reserialized for the target platform, but that is not a safe time to change anything outside of the Asset itself. There are also the Build callbacks, e.g. IProcessSceneWithReport

    Fixing this problem may involve checking BuildPipeline-isBuildingPlayer inside the method, and potentially disabling any action it performs when invoked during a build. E.g. in particular keeping an eye out for anything that might be deleting objects related to project settings.
     
    samol2014 likes this.
  30. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    From the QA reply mentions that it's caused by official package that needs to fix by official. Anyway I think Unity editor needs to improve to make it able to just log the exact error that tells u which code with line number goes wrong.
     
    samol2014 and StefanWo like this.
  31. samol2014

    samol2014

    Joined:
    Oct 17, 2019
    Posts:
    3
    For me personally it was fixed when I added all available Locales to Localization settings. I am using Unity Localization package and I filtered available languages in my app by excluding some Locales from Available Locales in Localization settings. After I restored all of them in Available Locales list (I filter them in runtime with a config now) the problem has gone.
     
  32. Tortuap

    Tortuap

    Joined:
    Dec 4, 2013
    Posts:
    124
    We need some help here. How could we narrow down the investigation? I'm not sure what to look for, or where to look for it.

    Could we dump all instance IDs in a text file at end of step 1, to get more information about he culprit? Could this work?
     
  33. Tortuap

    Tortuap

    Joined:
    Dec 4, 2013
    Posts:
    124
    Hi @AndrewSkow
    So I have dumped all instances IDs just like I said in my previous post.
    I found that on one of my case where the bug happened, the missing instance ID was -10690280, I couldn't not find it in my dumps, but I found two instance IDs nearest to that number:
    PreloadData : -10690284
    PreloadData : -10690282

    Could PreloadData be a clue of what could happen? Could it be something to investigate for?
    The only thing I can find in Unity official documentation is https://docs.unity3d.com/Manual/ClassIDReference.html where PreloadData appears in a list.
     
    StefanWo likes this.