I’m getting these errors in 2019.3.0b1 when creating a new project. They appear immediately after creating a new project (3D template). On a Mac here.
Assertion failed on expression: ‘txn.Exists(guid)’
Assertion failed on expression: ‘false’
The editor layout could not be fully loaded, this can happen when the layout contains EditorWindows not available in this project
UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
For what it’s worth, there seems to be a workaround. If you quit Unity, and then open Visual Studio (or VS Code) with some of your project files before restarting Unity, the assertion failure errors go away. (I can only confirm that this works with 2019.3.0b1, so YMMV.)
Are you able to reproduce the behaviour consistently? The fix went into b7 and was verified against the available reproduction steps. If this continues to be an issue for you, a bug report with reproduction steps would be much appreciated.
I wasn’t able to repro in a fresh project but I recorded a video of it happening in 2019.3.0b11:
It seems this starts happening when
working in a project (no error)
creating a git branch with some new assets (meshes / textures / scripts / prefabs / scenes / asmdefs …)
switching back to the master branch
opening Unity again.
this even results in complete crashes on first open sometimes, I also saw messages about “library is corrupted, please do a reimport” which went away on 2nd try
and it results in those serialization issues.
So my assumption is that AssetDatabase v2 caches stuff incorrectly that is actually gone but is not able to properly clean itself from those assets that “suddenly” went missing again (when switching back to master branch).
I’ll try reproducing but I’m not sure this even happens in “simple” projects.
EDIT: So I tried running AssetDatabase.ForceReserializeAssets on the affected project and it seems to log the above error message for every asset, multiple times - note the 220.000 errors after running this command:
Came here top hit from Google … seems to be the same bug present in 2019.3.5 (!).
Reading @fherbst 's post, I think I know what happend for me:
Working on a networked multiplayer project based off Unity’s own networking (although now using one of the community ports, because of course Unity killed theirs off)
…so (by design) need to have two copies of the Editor open with the same source: one to test client builds, one to test server builds (otherwse you simply can’t do multiplayer development; the whole Play mode would be useless, since Unity only allows you to run one instance of Play mode at a time)
Used the common trick of symlinking one of the script folders between two projects, so they have exactly the same source (for that folder only! Each of them has fully seaprate other folders, and 99% seaprate Assets folders)
…and then I did a “git commit” from one project, and tabbed back to the other project, and got hit with this:
“Assertion failed on expression: ‘insideBlock || node.IsInline() || node.IsScalar()’
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()”
Now … I understand that Unity officially doesn’t support symlinking folders (although that’s a bit embarassing: it’s a core OS feature, not some weird thing to be ignored!), but I don’t think AssetDatabasev2 should be collapsing on this. Not least because of how important/common the technique is for networking developers (from years before Unity).
I am not really sure how to reproduce it as I only saw it one time. I just restarted the editor and it is not happening any more. I will if I see it again.