[0.51.1] Loading Entity Scene failed because the entity header file couldn't be resolved

Sometimes I will get this error and need to restart editor and clear entities cache to fix it. Does this issue has been fully solved at 1.0 release?

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:\xxx\Logs. scenePath=Assets/xxx/xxx.unity guid=xxx
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_883010961.g.cs:231)
Unity.Scenes.ResolveSceneReferenceSystem:ResolveSceneReferenceSystem_LambdaJob_0_Execute (bool&) (at Temp/GeneratedCode/Unity.Scenes/ResolveSceneReferenceSystem__System_883010961.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)

2 Likes

I wish it had. I am getting this way more often than I ever had before (On Linux). At the moment it is, unfortunately, happening more often than not whenever I open a subscene and save it. I then have to try a bunch of things such as removing all items, saving the scene, restarting Unity, putting the things back in, etc. Most of the time, though, I try that and it just gives me the header file cannot be resolved error again. So I delete the scene, try and put the items in a new one. Some of the time it works again at that point, but chances are still pretty high that I just get the same error again.

1 Like

I’m also fighting this in 1.0.

Anyone facing the Loading Entity Scene failed because the entity header file couldn’t be resolved issue:

I’ve figured out that this issue is rarely related to the problem with the SubScene itself, but instead is cause by the Exception thrown by Burst compilation during the SubScene import. To try and identify the source of the real problem you can:

  1. Disable the SubScene in the Hierarchy and run the PlayMode - sometimes it shows the bugs and exceptions that are not show with the SubScene being turned on (such as
    GetSingleton() requires that exactly one entity exists that matches this query, but there are {0}
    )

  2. After getting the Loading Entity Scene failed because the entity header file couldn’t be resolved error, go to /Logs folder of your project and open the "AssetImportWorker[0-N].log file.

Type in the “Exception” in the search - you will probably be able to find something like this:

In my case, the compilation exception was caused by incorrectly managing native collections. In yours - it might be smth else. Anyway, you can comment out the problematic code and try building again to check if it indeed is the source of the problem. Hope it helps!:roll_eyes: