Search Unity

Bug Error on Fresh Project w/ UI Toolkit 2021.1.10.2062

Discussion in 'UI Toolkit' started by Sparkkie, Mar 9, 2021.

  1. Sparkkie

    Sparkkie

    Joined:
    Oct 10, 2018
    Posts:
    12
    1 - Create New 2d Project
    2 - Install UI Toolkit Version 1.0.0-preview.14
    3 - Create A new UI Document, TSS file or Theme
    4 - Click the new asset, the following 5 errors appear in the console:

    [Worker0] Assertion failed on expression: 'state.state == kUpToDate'
    [Worker0] Assertion failed on expression: 'state.artifactID == result'
    [Worker0] Assertion failed on expression: 'ins.second || ins.first->second == artifactID || (ins.first->second == CircularDependencyArtifactID() && !artifactID.IsValid()) || GetPathFromAssetGuidV2(key.GetGUID()).ends_with(".cs")'
    [Worker0] Assertion failed on expression: 'state.state == kUpToDate'
    [Worker0] Assertion failed on expression: 'state.artifactID == result'​

    This happens for each individual asset the first time you select it, then if you reload, change it, or start/stop the editor the error will happen again.

    I really liked how my prototype worked in 2021.2 with UI Toolkit, so I thought I'd move down to 2021.1 which I assume will have a release soon to start working on the actual game.
    I can't seem to get a bare 2021.1 project to run UI Toolkit without errors, I wanted to get the latest UI Builder as well so I could use text shadow (which doesn't seem to be available right now in 2021.2)

    I can't find this error mentioned anywhere, is it possible I'm doing something wrong?
    Edit: I have already filed a bug report in Unity, it would just be neat if anybody knew a solution, it just fills my error console, everything still works as I understand it but I just can't really use the console for errors since they get bumped
     
    Last edited: Mar 9, 2021
    Nanomid likes this.
  2. griendeau_unity

    griendeau_unity

    Unity Technologies

    Joined:
    Aug 25, 2020
    Posts:
    248
    Which version of the Editor are you using? It might just be a wrong combination of versions. I remember seeing this error a while back but it was fixed in a patch version.

    Also good to know, you don't need the packages anymore in 2021.1 and over, they are included in Unity directly.
     
    Last edited: Mar 12, 2021
  3. Kazko

    Kazko

    Joined:
    Apr 2, 2014
    Posts:
    82
    I also have this issue in 2021.1.0b11 (but it's been there for couple of versions now).

    Also, after some editor update (not remember which version exact, though I guess it was the version which should had included UI Toolkit directly), the UI Toolkit was not functional. The UI Builder worked, but PanelSettings as well as font settings asset both had "missing scripts". I fixed it by manually adding com.unity.ui via package manager, which you stated should not be needed.
    However, the errors remained, as well as constant "Invalid value for font MissingAssetReference" console spam and broken UI Documents (missing sprites & fonts, broken layouts, etc.)

    How would we go about installing the package from scratch? Would that solve the issue?
     
    Last edited: Mar 16, 2021
    Jawsarn likes this.
  4. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    245
    Second this, need package for 2021.1.0b11 and can't debug the project anymore with Rider and the asserts popping up.
     
  5. griendeau_unity

    griendeau_unity

    Unity Technologies

    Joined:
    Aug 25, 2020
    Posts:
    248
    Right, sorry about the confusion. The package is still needed for Runtime components (UIDocument) in 2021.1.

    If you get broken layout when adding/switching/deleting package version, you might need to restart the editor or clear the Library folder.

    It seems the issue is still happening with 2021.1.0b12 and preview.14. Let me ask around I'll get back to you!
     
    wlwl2, SudoCat and Kazko like this.
  6. Kazko

    Kazko

    Joined:
    Apr 2, 2014
    Posts:
    82
    Are you referring to the "[Worker0] Assertion failed" errors?

    Is it possible that UI Documents became corrupted during one of the version upgrades? Couple of versions ago I made some UI Documents but stopped working on them because of constant console errors, I wanted to wait for newer version.

    I upgraded to 2021.1.0b12 and UI Tookit preview.14 and UI Builder preview.13 and all the errors are still present. On top of that, my old documents have unfixable font and sprite references. The whole builder seems very buggy, not sure what is causing this.

    1) I cannot update fonts
    - I get constant "invalid font" errors in console
    - There are two font references in Text options. "Font", and "Font Asset".
    Trying to set Font results in "IndexOutOfRangeException: Index was outside the bounds of the array." console error.
    Setting Font Asset errors in "Invalid value for font MissingAssetReference" and various fonts display different text results.
    Or sometimes I see this error: "Cannot create a FontDefinition, the type must be FontAsset"

    2) Cannot update sprites
    When I open my old documents, I get green triangle warnings in the layout that a sprite is missing. However I can't set a new sprite. Some sprites work, others result in warnings and yellow triangles. "Image not found for path: Icons/Bolt_00" - but the file exists and is a valid sprite. I am choosing it via the UI Biulder's picker ...

    3) UI Builder asks if I want to save the document not when closing the window, but when opening another document. Even if it's a different document, the builder comes up with a question to save work on the previous document.

    This seems like some kind of corruption or perhaps underlying conflict in packages? Does not seem like "preview" version.
     
  7. SudoCat

    SudoCat

    Joined:
    Feb 19, 2013
    Posts:
    65
    Just upgraded my existing 2D project from 2020.2.6f1 to 2021.1.0f1 and I'm seeing the same "[Worker0] Assertion failed" errors. Already had UI Toolkit preview-14 installed.

    When I purged the Library folder, the error did not appear on next start-up, but promptly re-appeared after starting and exiting playmode on an empty scene.

    --

    Upon some further testing, I abandoned the branch, and ran through the upgrade process again. It seems like the errors appear when opening any folder in the project view which contains either uxml or uss files. They only appear once per application reload (after entering playmode/recompiling).

    Uninstalling the UIToolkit package and restarting Unity stops the errors - but then I cannot use any of the runtime features

    Is there a bug tracker link for this that I could follow?
     
    Last edited: Mar 26, 2021
  8. Smolty

    Smolty

    Joined:
    Nov 8, 2016
    Posts:
    17
    Got the same error in Unity 2021.1.0f1.

    For me it pops up everytime I select a .uss or .uxml file in the Project panel after it has been reimported or after changing code and the editor refreshes but only if the Inspector panel is visible.
    So right clicking on a .uss or .uxml file and pressing reimport while Inspector is visible, will always throw the error.
    The error never shows up when the Inspector panel is closed or hidden.

    Right now I just avoid selecting .uss or .uxml files in the Project panel when I don't need them or hide the Inspector while I don't need it.
     
    Last edited: Mar 26, 2021
    SudoCat likes this.
  9. pierre_10

    pierre_10

    Unity Technologies

    Joined:
    Apr 1, 2016
    Posts:
    33
    this looks like a defect from the import pipeline team, its now fixed and should get to you soon: bug ID 1292545
     
    Nanomid likes this.
  10. SudoCat

    SudoCat

    Joined:
    Feb 19, 2013
    Posts:
    65
    That's great to hear, thanks. How do I use that bug ID? I couldn't find a way to use it on the issue tracker or fogbugz - is there another bug tracker?
     
    wlwl2 likes this.
  11. SudoCat

    SudoCat

    Joined:
    Feb 19, 2013
    Posts:
    65
    Well it looks like the freshly released 2021.1.1f1 resolved... one out of 3 errors? :oops:

    upload_2021-4-1_10-49-12.png
     
    wlwl2 likes this.
  12. dimakevanishvili

    dimakevanishvili

    Joined:
    Jan 31, 2021
    Posts:
    1
    I've got the same issue. Just updated to 2021.1.1f1. Can also confirm that it fixed one of the 3 errors.
    I'm getting these errors repeatedly 12 times(24 errors in total) once I open and close an uxml file with the UI Builder.
    I'm guessing that the repeating is caused by me having 6 uxml files in the same directory but I'm not sure.
    upload_2021-4-1_17-22-35.png
     
  13. DonFaddoul

    DonFaddoul

    Joined:
    Feb 2, 2020
    Posts:
    6
    Same errors on the latest released version of Unity 2021.1.5f1.
     

    Attached Files:

  14. ManuelSegura

    ManuelSegura

    Joined:
    Dec 12, 2015
    Posts:
    19
    Same errors on the lates released version of Unity 2021.1.7f1

    They only appear after I enter and exit Play Mode for the first time.

    upload_2021-5-17_2-23-52.png
     
    wlwl2 likes this.
  15. wlwl2

    wlwl2

    Joined:
    Jun 17, 2018
    Posts:
    29
    Restarting the editor seems to fix the problem only for my case, it might not be for yours. It would always happen when a certain prefab was open and selected in the project and you just exit play mode.

    Edit: it still keeps happening occasionally (2021.1.15f1).
     
    Last edited: Jul 28, 2021
    Nanomid likes this.
  16. unity_z2q74o1W_t3zDQ

    unity_z2q74o1W_t3zDQ

    Joined:
    Mar 2, 2021
    Posts:
    1
    Any news on this?

    Code (CSharp):
    1. [Worker0] Assertion failed on expression: 'state.state == kUpToDate'
    2. [Worker0] Assertion failed on expression: 'state.artifactID == result'
    3. [Worker0] Assertion failed on expression: 'state.state == kUpToDate'
    4. [Worker0] Assertion failed on expression: 'state.artifactID == result'
    It's annoying that one can get bugs like these on a new project.
    Looks like this has been a bug for at least 4 months... can we get this resolved?
    It's not exactly encouraging when you try out a new package, just to immediately get errors...

    UI Toolkit: Version 1.0.0-preview.14
    2021.1.12f1
     
    Last edited: Jul 5, 2021
  17. magnetic_scho

    magnetic_scho

    Joined:
    Feb 2, 2020
    Posts:
    95
    I also get these errors after updating to 1.0.0-preview.15 in 2021.1.15f.

    Any news on if this will be fixed?
     
    OmniDeveloper likes this.
  18. OmniDeveloper

    OmniDeveloper

    Joined:
    Dec 15, 2018
    Posts:
    2
    Same issue as magnetic_scho while using the same versions.
     
  19. Daxten

    Daxten

    Joined:
    Sep 20, 2013
    Posts:
    30
    install com.unity.ui.builder by name, and make sure both are on the same preview version (e.g. preview.15 for the latest)

    I think the problem is that unity preview ships with a builder installed internally, which is compatible with preview.14. After updating toolkit to a different version the builder shiped won't be supported anymore
     
  20. GoodGuyA

    GoodGuyA

    Joined:
    Aug 17, 2014
    Posts:
    2
    I am getting these same errors on version Preview 16. It removes my ability to change the text on any of the elements, because above the Stylesheet drop down there's a dropdown called "Attributes" which has nothing. On Unity version 2021.1.17f1, all freshly installed today.
     
    d3magexgod likes this.
  21. magnetic_scho

    magnetic_scho

    Joined:
    Feb 2, 2020
    Posts:
    95
    @Daxten Which
    Unity version are you referring to?
    Can you post the Ui Toolkit/UI Builder entries out of manifest.json?
     
  22. jradvan

    jradvan

    Joined:
    Nov 17, 2015
    Posts:
    4
    I am seeing the same errors with Preview 16 on 2021.1.16f1, upgraded today from Preview 15. I was having them on 15 as well. Reproducible by showing a folder containing uxml, uss and PanelSettings.asset files after exiting playmode, or entering playmode with such a folder selected.

    Incidentally that upgrade also made all of my TextField elements un-writable??? *edit* the TextField issue seems to have been fixed by an upgrade to 2021.1.17f1.

    Code (csharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.collab-proxy": "1.7.1",
    4.     "com.unity.ide.rider": "3.0.7",
    5.     "com.unity.ide.visualstudio": "2.0.9",
    6.     "com.unity.ide.vscode": "1.2.3",
    7.     "com.unity.test-framework": "1.1.27",
    8.     "com.unity.textmeshpro": "3.0.6",
    9.     "com.unity.timeline": "1.5.6",
    10.     "com.unity.ugui": "1.0.0",
    11.     "com.unity.ui": "1.0.0-preview.16",
    12.     "com.unity.ui.builder": "1.0.0-preview.16",
    13.     "com.unity.visualscripting": "1.6.1",
    14.     "com.unity.modules.ai": "1.0.0",
    15.     "com.unity.modules.androidjni": "1.0.0",
    16.     "com.unity.modules.animation": "1.0.0",
    17.     "com.unity.modules.assetbundle": "1.0.0",
    18.     "com.unity.modules.audio": "1.0.0",
    19.     "com.unity.modules.cloth": "1.0.0",
    20.     "com.unity.modules.director": "1.0.0",
    21.     "com.unity.modules.imageconversion": "1.0.0",
    22.     "com.unity.modules.imgui": "1.0.0",
    23.     "com.unity.modules.jsonserialize": "1.0.0",
    24.     "com.unity.modules.particlesystem": "1.0.0",
    25.     "com.unity.modules.physics": "1.0.0",
    26.     "com.unity.modules.physics2d": "1.0.0",
    27.     "com.unity.modules.screencapture": "1.0.0",
    28.     "com.unity.modules.terrain": "1.0.0",
    29.     "com.unity.modules.terrainphysics": "1.0.0",
    30.     "com.unity.modules.tilemap": "1.0.0",
    31.     "com.unity.modules.ui": "1.0.0",
    32.     "com.unity.modules.uielements": "1.0.0",
    33.     "com.unity.modules.umbra": "1.0.0",
    34.     "com.unity.modules.unityanalytics": "1.0.0",
    35.     "com.unity.modules.unitywebrequest": "1.0.0",
    36.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    37.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    38.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    39.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    40.     "com.unity.modules.vehicles": "1.0.0",
    41.     "com.unity.modules.video": "1.0.0",
    42.     "com.unity.modules.vr": "1.0.0",
    43.     "com.unity.modules.wind": "1.0.0",
    44.     "com.unity.modules.xr": "1.0.0"
    45.   }
    46. }
    47.  
     
    Last edited: Aug 18, 2021
  23. d3magexgod

    d3magexgod

    Joined:
    Dec 14, 2019
    Posts:
    1
    Wanted to implement UI with UIBuilder but I can't make a build with it :/ Also confirm @GoodGuyA bug that Attributes menu has nothing in it. Unity 15f1
     
  24. CoryMaklin

    CoryMaklin

    Joined:
    Oct 10, 2020
    Posts:
    29
    I'm seeing this issue as well.
     
  25. InfiBatnisGame

    InfiBatnisGame

    Joined:
    Jun 26, 2019
    Posts:
    17
    Today test , today show up error
    [Worker4] Assertion failed on expression: 'state.state == kUpToDate'
    [Worker4] Assertion failed on expression: 'state.artifactID == result'
    Cannot open uxml to ui builder, but auto open to visual studio.
    After install com.unity.ui.builder show like this
    Screenshot (23).png
    But, Restart unity, problem solve
    Another problem, c# (window editor to create uielement) broken, cannot open (menuitem("../..")) when I click, but I delete script file and recreate(copy and paste), problem solve.

    using 2021.1.20f1
    UI Builder 1.0.0-preview.17
    UI Toolkit 1.0.0-preview.17

    but still get this
    [Worker4] Assertion failed on expression: 'state.state == kUpToDate'
    [Worker4] Assertion failed on expression: 'state.artifactID == result'
     
    Last edited: Sep 14, 2021
  26. azmi_unity

    azmi_unity

    Joined:
    Dec 13, 2020
    Posts:
    62
    Same. Restarting the editor doesn't fix it for me. Happens when I open a UXML file in the project browser.

    [Worker0] Assertion failed on expression: 'state.state == kUpToDate'
    [Worker0] Assertion failed on expression: 'state.artifactID == result'


    Unity 2021.1.20f1
    UI Builder and UI Toolkit at 1.0.0-preview.17
     
  27. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    These assertions are not UI Toolkit's fault, and they've been sent to the team responsible already, we just have to wait for their fix. However this should not be breaking anything for you that we're aware of, so if that's not the case please let us know.

    Reminder that we recommend that if you want to use one of the packages (UI Toolkit or UI Builder), we recommend you use both packages, with the same version number (currently latest is preview.17 for both).
     
  28. ColtonRamos

    ColtonRamos

    Joined:
    Nov 4, 2015
    Posts:
    15
    Aww. I'm having the same issue.

    1. Create a new URP project in 2021.1.21f1
    2. Import the com.unity.ui package to get UI elements
    3. Create a new UI document
    4. Immediately errors in the console when I click on it



    So I should be installing UI Builder? What's the package id for that one?
     
  29. CoryMaklin

    CoryMaklin

    Joined:
    Oct 10, 2020
    Posts:
    29
    It's com.unity.ui.builder, but that won't solve your issue.
     
  30. visose

    visose

    Joined:
    Nov 2, 2014
    Posts:
    28
    Do you mean that the UI Toolkit package assumes the UI Builder package is also present, and if not, unexpected errors might happen?

    If a package requires another, it should be added as a dependency so that the package manager installs all the required packages. But if both depend on each other (circular dependency), why split into two packages?

    Wouldn't it be cleaner to architect it so that UI Builder depends on UI Toolkit but not the other way around?
     
    Last edited: Sep 22, 2021
  31. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    Neither package really depends on the other. What we suggest is that if you want to use UI Toolkit in the package version, that you also use UI Builder from the package version, to guarantee that the internal APIs match.

    Consider these scenarios valid:
    • Built-in UI Toolkit and UI Builder package
    • UI Toolkit package and UI Builder package
    • UI Toolkit package and not using the UI Builder at all, so you don't need to install additional packages
    Now if you use UI Toolkit package and built-in UI Builder, there's a change everything will work depending on your exact version of Unity because internal APIs may change and older versions of Unity may not be directly compatible, which is why we recommend that if you want the UI Toolkit package and the UI Builder, you also use the UI Builder in package version.
     
  32. SlowpokeFarm

    SlowpokeFarm

    Joined:
    May 6, 2018
    Posts:
    24
    I have both packages installed with matching version, but that didn't solve the issue.
     
  33. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    What issue exactly?

    If we're talking about the "[Worker 0] Assertion failed" messages, as I said before, that's being handled by a separate team as it's not coming from UI Toolkit itself.
     
  34. tacman1123

    tacman1123

    Joined:
    Sep 14, 2020
    Posts:
    77
    [Worker0] Assertion failed on expression: 'state.artifactID == result'

    and 11 other assertion errors.

    Fresh project, with nothing else installed besides UI Toolkit and UI Builder (both at prview.117).

    Unity 2021.1.21f1, running on Linux.
     
  35. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    You can ignore these errors. They're not going to interfere with you working on your project, at least from all we've seen. If this is stopping you from working on your project, please let us know what's happening so we can look into it, but so far what we've seen is that it can be ignored.

    This is being fixed by a different team, it's not coming from UI Toolkit, and eventually a version of Unity should have it fixed and it'd stop happening.
     
  36. AlienFreak

    AlienFreak

    Joined:
    Jul 2, 2012
    Posts:
    40
    I am getting scrambled, unreadable text in the Package Manager and any UI Toolkit asset.

    This is on Mac OS Big Sur, Unity 2021.1.23 with the UI Toolkit and UI Builder preview 17 packages. I can't even work till this is readable. Solution?
     

    Attached Files:

  37. AlienFreak

    AlienFreak

    Joined:
    Jul 2, 2012
    Posts:
    40
    Also, rebooting and restarting Unity had no effect. Deleting the Library, reimporting all assets had no effect.
     
  38. One_Learning_Man

    One_Learning_Man

    Joined:
    Sep 30, 2021
    Posts:
    81
    I am getting the same error on start-up (Unity 2021.1.23f1). What I did: started building my UI using the built-in UI Toolkit. Realized I will need to download the package version for runtime support and downloaded that along with UI Builder.

    UI Toolkit = 1.0.0 Preview 18
    UI Builder = 1.0.0 Preview 17

    Went to bed and woke up and started working again and upon project loading, I see these errors pop up:

    upload_2021-10-9_8-55-59.png
     
  39. elitegoliath13

    elitegoliath13

    Joined:
    Dec 3, 2017
    Posts:
    9
    I'm also getting the following errors at very high frequency:

    • [Worker0] Assertion failed on expression: 'state.state == kUpToDate'
    • [Worker0] Assertion failed on expression: 'state.artifactID == result'

    And I'm getting these errors while following the standard workflow from scratch:

    • Trying to read value of type Enum while reading a value of type MissingAssetReference UnityEngine.UIElements.UIElementsRuntimeUtilityNative:UpdateRuntimePanels ()
    • Trying to read value of type Enum while reading a value of type MissingAssetReference
      UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    • Trying to read value of type Enum while reading a value of type MissingAssetReference
      UnityEngine.UIElements.VisualTreeStyleUpdaterTraversal:TraverseRecursive (UnityEngine.UIElements.VisualElement,int)
      Unity.UI.Builder.BuilderVisualTreeStyleUpdaterTraversal:TraverseRecursive (UnityEngine.UIElements.VisualElement,int) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.18/Editor/Builder/Viewport/BuilderVisualTreeStyleUpdaterTraversal.cs:68)

    Unity: 2021.1.23f1
    UI Builder: 1.0.0-preview.18
    UI Toolkit: 1.0.0-preview.18
     
    Last edited: Oct 20, 2021
  40. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Seeing this error after upgrading the project from 2019.4.38 to 2020.3.34
    I have deleted Library forlder and reimported everything, but it didn't help.
    I don't use any UI packages, only basic Unity UI 1.0.0
    Every time i click on the new asset i haven't clicked yet in this session, a getting this:

    [Worker0] Assertion failed on expression: 'state.state == kUpToDate'
    [Worker0] Assertion failed on expression: 'state.artifactID == result'
    [Worker0] Assertion failed on expression: 'state.state == kUpToDate'
    [Worker0] Assertion failed on expression: 'state.artifactID == result'

    Is there any fix for this in 2020.x? It's very annoying.
     
    pointcache and trombonaut like this.
  41. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    If you don't have the UI Toolkit or UI Builder packages installed, then this forum won't be able to help you much. You can check if anyone's reporting it on the Editor General Support forum, and you can always submit a bug from Unity (Help > Report a Bug).
     
  42. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    Same issue, my "solution" is to use Console Enhanced and tag those as "Useless Unity Errors"
    which filters them out of the console. I don't even want to know why im getting this over several LTS versions (2020.3.37f1 currently) and why nobody at unity ever encountered this issue.