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

Bug Subscene entity header file couldn't be resolved (Burst error)

Discussion in 'Burst' started by charleshendry, Dec 7, 2020.

  1. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    95
    I think I must have upgraded a package as my subscene can no longer be converted to entity representation (can't remember why this problem started). I upgraded to the latest version of burst (1.5.0-pre.3) in case that's the error, but didn't help. I've tried reimport all, re-creating the subscene and creating a new project and re-importing assets.

    Log file extract below. Anyone had similar issues? Or is this related to the UI package issue with subscenes others were having? I can't uninstall Unity UI as it claims it's being used by URP (although not shown as a dependacy there).

    Code (CSharp):
    1. Exception thrown during SubScene import: System.IO.FileNotFoundException: Could not load file or assembly 'Unity.Burst.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    2. File name: 'Unity.Burst.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=null'
    3.   at Unity.Entities.World..ctor (System.String name, Unity.Entities.WorldFlags flags) [0x00052] in D:\Unity Projects\Mafia Wars\Library\PackageCache\com.unity.entities@0.16.0-preview.21\Unity.Entities\World.cs:486
    4.   at Unity.Entities.World..ctor (System.String name) [0x00000] in D:\Unity Projects\Mafia Wars\Library\PackageCache\com.unity.entities@0.16.0-preview.21\Unity.Entities\World.cs:474
    5.   at Unity.Scenes.Editor.EditorEntityScenes.ConvertAndWriteEntitySceneInternal (UnityEngine.SceneManagement.Scene scene, Unity.Entities.GameObjectConversionSettings settings, System.Collections.Generic.List`1[T] sectionRefObjs, Unity.Scenes.Editor.WriteEntitySceneSettings writeEntitySettings) [0x00022] in D:\Unity Projects\Mafia Wars\Library\PackageCache\com.unity.entities@0.16.0-preview.21\Unity.Scenes.Editor\EditorEntityScenes.cs:169
    6.   at Unity.Scenes.Editor.SubSceneImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) [0x001c7] in D:\Unity Projects\Mafia Wars\Library\PackageCache\com.unity.entities@0.16.0-preview.21\Unity.Scenes.Editor\SubSceneImporter.cs:154
     
  2. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    95
    Thanks to @jdtec, downgrading from b14 to b13 solved it.
     
    jdtec likes this.
  3. unity_tzKpZbkF_dMEIA

    unity_tzKpZbkF_dMEIA

    Joined:
    Aug 18, 2019
    Posts:
    4
    Same error with 2020.2.0f1 if you have UI Toolkit in your project
     
  4. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    175
    I had a similar issue today with that same error message, my subscene wasn't being imported/converted to entity representation anymore. And the error was so bad that the [Import] button on the subscene wasn't even appearing in the Inspector.

    Turns out there was a compilation error in another authoring script inside that subscene, but Unity console wasn't reporting that error. Thankfully, the console did point me to an "AssetImportWorkerX.log" file, related to the subscene import process (in <your Unity project>\Logs folder).
    In that log file, I located the actual error, fixed it, and then the subscene worked correctly again. :D
     
  5. AdamBebko

    AdamBebko

    Joined:
    Apr 8, 2016
    Posts:
    164
    Unity said that this bug was fixed in 2020.3 with the new UIToolkit releases (sept 2021) and the most recent entities package. I still haven't tested but other users are reporting it's working ok now with UIToolkit.
     
  6. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    988
    Last I tested we still had issues if you had entities UITK and new input system at the same time in your project. If you remove either UITK or new input there is no longer an issue.
     
  7. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    175
    Just to clarify, I use Entities but I don't use UI Toolkit or New Input System. Even so, I still had an error with that same message ("Loading Entity Scene failed because the entity header file couldn't be resolved."), but for a different reason (a compilation error/missing reference in an authoring script inside the subscene).

    I also want to share another (even more serious) subscene import error I had recently, that I think isn't documented anywhere:

    Suddenly, my subscenes stopped working. Worse, every time I ran Play Mode, the failed subscene import made the Editor freeze completely. (needed to Alt+Ctrl+Del to close Unity process)
    And during that freeze, the "AssetImportWorkerX.log" files were getting to the 10's, 20's. If the number of files gets that high, that's a red flag. :p

    Turns out there were some recently added assets in my project, which broke the subscene import process for some reason. But the Console and log files weren't giving any clue on what was causing that freezing issue.

    In my case, the culprits were uContext and Odin Inspector.
    At first, the subscene was working normally even after I added those assets, but that was only because the subscene was being loaded from a previous working version from the Entities cache. Eventually, it stopped working.
    I soon tried removing those recent assets, but the subscene import was still freezing regardless (again, because of the Entities cache).

    So, I basically started adding/removing assets from my project, ALWAYS restarting the Editor AND clearing the Entities caches (top bar -> DOTS -> Clear Entities Cache(s) -> clear all caches) each time I added/removed assets, until I could isolate the ones that were making the subscenes import to freeze.

    I repeat, restarting the Editor and (especially) clearing the Entities caches made all the difference to my tests, to ensure I wasn't loading a previously cached working/broken version of the subscenes.

    Then, after removing the culprit assets and clearing the Entities caches once more, the subscenes worked normally again. :D
     
    Last edited: Sep 25, 2021
    andywatts and WAYNGames like this.
  8. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    760
    I didn't see any error on the subscene game-object, so I checked the specified log folder, and the latest log was from yesterday even though I've been trying to build and load the scene today. So I closed Unity, deleted all the log files, and restarted Unity. Tried opening and closing the subscene several times but got the same error. I attempted restarting the editor and clearing the entities cache several times. The only log file is a shader compiler log file and it's basically empty. 2021.3.7 with 0.51.preview21 - not using UI package at all.

    upload_2022-8-8_17-31-53.png

    Loading Entity Scene failed because the entity header file couldn't be resolved. This might be caused by a failed import of the entity scene. Please take a look at the SubScene MonoBehaviour that references this scene or at the asset import worker log in C:\Code\Buggy\Logs. scenePath=Assets/Scenes/SampleScene/SpawnablesSubScene.unity guid=ce15164c67c0e704889ba22b15c41aed
    UnityEngine.Debug:LogError (object)
    Unity.Debug:LogError (object) (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Entities/Stubs/Unity/Debug.cs:13)
    Unity.Scenes.SceneHeaderUtility:LogHeaderLoadError (Unity.Scenes.SceneHeaderUtility/HeaderLoadStatus,Unity.Entities.Hash128) (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Scenes/SceneHeaderUtility.cs:423)
    Unity.Scenes.SceneHeaderUtility:FinishHeaderLoad (Unity.Scenes.RequestSceneHeader,Unity.Entities.Hash128,string) (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Scenes/SceneHeaderUtility.cs:189)
    Unity.Scenes.ResolveSceneReferenceSystem/ResolveSceneReferenceSystem_LambdaJob_0_Job:OriginalLambdaBody (Unity.Entities.Entity,Unity.Scenes.RequestSceneHeader&,Unity.Entities.SceneReference&,Unity.Scenes.ResolvedSceneHash&,Unity.Entities.RequestSceneLoaded&) (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Scenes/ResolveSceneReferenceSystem.cs:211)
    Unity.Scenes.ResolveSceneReferenceSystem/ResolveSceneReferenceSystem_LambdaJob_0_Job:RunWithStructuralChange (Unity.Entities.EntityQuery) (at Temp/GeneratedCode/Unity.Scenes/ResolveSceneReferenceSystem__System_1568067297.g.cs:231)
    Unity.Scenes.ResolveSceneReferenceSystem:ResolveSceneReferenceSystem_LambdaJob_0_Execute (bool&) (at Temp/GeneratedCode/Unity.Scenes/ResolveSceneReferenceSystem__System_1568067297.g.cs:254)
    Unity.Scenes.ResolveSceneReferenceSystem:OnUpdate () (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Scenes/ResolveSceneReferenceSystem.cs:197)
    Unity.Entities.SystemBase:Update () (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Entities/SystemBase.cs:400)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Entities/ComponentSystemGroup.cs:583)
    Unity.Entities.ComponentSystemGroup:OnUpdate () (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Entities/ComponentSystemGroup.cs:523)
    Unity.Entities.ComponentSystem:Update () (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Entities/ComponentSystem.cs:114)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Entities/ComponentSystemGroup.cs:583)
    Unity.Entities.ComponentSystemGroup:OnUpdate () (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Entities/ComponentSystemGroup.cs:523)
    Unity.Entities.InitializationSystemGroup:OnUpdate () (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Entities/DefaultWorld.cs:28)
    Unity.Entities.ComponentSystem:Update () (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Entities/ComponentSystem.cs:114)
    Unity.Entities.ScriptBehaviourUpdateOrder/DummyDelegateWrapper:TriggerUpdate () (at Library/PackageCache/com.unity.entities@0.51.1-preview.21/Unity.Entities/ScriptBehaviourUpdateOrder.cs:426)

    So... uhhh.... what do you do when there is no error and no log entry??

    EDIT: So I have no idea why this worked, but I selected the broken subscene in the Hierarchy, then double-clicked the Scene Asset, and then checked the "ConvertToEntity" box for the two authoring game-objects in the scene. No idea why the box wasn't checked because I think it's supposed to be automatic for subscenes. After going back to the main scene, the log file started showing up and everything built correctly again. For what it's worth, the error first started happening when I was building a player in develop mode.
     
    Last edited: Aug 9, 2022