Search Unity

Question [Platform 0.9.0] Loading Entity (Sub)Scene failed because the entity header file couldnt be resolved

Discussion in 'Entity Component System' started by Samsle, Nov 15, 2020.

  1. Samsle

    Samsle

    Joined:
    Mar 31, 2020
    Posts:
    110
    Hello,
    I run into trouble with subscenes since I updated some packages: "Loading Entity (Sub)Scene failed because the entity header file couldn't be resolved."
    {
    "dependencies": {
    "com.unity.burst": "1.3.7",
    "com.unity.collab-proxy": "1.3.9",
    "com.unity.collections": "0.14.0-preview.16",
    "com.unity.entities": "0.14.0-preview.19",
    "com.unity.ide.rider": "2.0.7",
    "com.unity.ide.visualstudio": "2.0.5",
    "com.unity.ide.vscode": "1.2.3",
    "com.unity.netcode": "0.5.0-preview.5",
    "com.unity.physics": "0.4.1-preview",
    "com.unity.platforms.android": "0.9.0-preview.9",
    "com.unity.platforms.linux": "0.9.0-preview.9",
    "com.unity.platforms.windows": "0.9.0-preview.9",
    "com.unity.render-pipelines.universal": "10.1.0",
    "com.unity.rendering.hybrid": "0.10.0-preview.21",
    "com.unity.scriptablebuildpipeline": "1.9.0",
    "com.unity.searcher": "4.3.1",
    "com.unity.shadergraph": "10.1.0",
    "com.unity.test-framework": "1.1.18",
    "com.unity.test-framework.performance": "2.3.1-preview",
    "com.unity.textmeshpro": "3.0.3",
    "com.unity.timeline": "1.4.4",
    "com.unity.ui": "1.0.0-preview.11",
    "com.unity.ui.builder": "1.0.0-preview.9",
    "nuget.mono-cecil": "0.1.6-preview",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
    }
    }

    Somehow it cannot load the subscene properly. It does not work with Unity 2020.2.0b10/11, but it works with Unity 2021.1.0a2/4, but only in the editor. Running it with a platform build for windows/android using the newest package 0.9.0, it still throws an error ("could not open file .../StreamingAssets/SubScenes/xxx.entityheader subscenes for read").

    (This leads also to a Netcode problem, since a entity in the subscene gets not converted, which should have the component GhostPrefabCollectionComponent, needed in GoInGameServerSystem.cs)
     
    charleshendry and florianhanke like this.
  2. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    charleshendry and Samsle like this.
  3. Samsle

    Samsle

    Joined:
    Mar 31, 2020
    Posts:
    110
    Thanks @thelebaron, that's it! :)
    How did you find out? I'm so angry about myself that I can't read stacktraces properly -.- I just saw this entity header message and was lost for hours without clue how to continue...
     
    adammpolak likes this.
  4. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    I cant read those stacktraces either ;) but usually after losing a bit sanity & deleting the library and other bog standard attempts to fix the issue, i make a packages only project to test for errors and(assuming there are errors with just the packages) go through the tedium of removing packages to see which one is the culprit
     
    Samsle likes this.
  5. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    Is this issue fixed for real? I'm getting

    using 1.0.0-preview.14, with 2020.3.6f1, build and run. Or is a repro?
     
  6. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    No it's not there is a whole thread in the ui forum about it. There are very simple steps to reproduce yet Unity can't seem to reproduce it. It's very frustrating...
    On a side note from my last testing it does not happen with unity 2021... Which does not help much given the warning in the forum about dots/2021 compatibility...
     
    Last edited: Jul 7, 2021
    adammpolak likes this.
  7. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    Yeah, totally..
     
  8. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    I think I managed to get it fixed, which caused by `SubScene` integrated with `UIToolKit(specifically 1.0.0-preview.14)` when building.

    The key is: Subscenes will not be built properly while UIToolKit is installed.(and Unity will give an error log while building)


    So you just have to build subscenes without UIToolKit, fortunately you will find new building subscene header is exactly the same subscene header that Unity build and run console report missing, then you manually put these headers back where they came from after you built subscenes with UIToolKit.
    upload_2021-7-12_16-36-42.png
    upload_2021-7-12_16-36-51.png

    Here's what I do:
    1. Backup my proper built subscene headers(Unity project\Builds\WindowsClassicBuildConfiguration\Project Name_Data\StreamingAssets\SubScenes).
    2. Get UIToolKit back online, click build and wait is done.
    3. Check out what subscene headers are missing and get them from previous backup subscenes to `\SubScenes` file.
    4. Click run.

    Now `SubScene` and `UIToolKit can finally build and run together.(I will edit again if anything goes up)
     
    Last edited: Jul 12, 2021
    psuong likes this.