Trying to read value of type Enum while reading a value of type Keyword
UnityEngine.UIElements.StyleSheet:ReadEnum(StyleValueHandle)
Unity.UI.Builder.StyleValueHandleExtensions:GetEnum(StyleSheet, StyleValueHandle) (at Library/PackageCache/com.unity.ui.builder@0.9.0-preview/Editor/Utilities/StyleSheetExtensions/StyleValueHandleExtensions.cs:144)
Unity.UI.Builder.BuilderInspectorStyleFields:RefreshStyleField(String, VisualElement) (at Library/PackageCache/com.unity.ui.builder@0.9.0-preview/Editor/Builder/Inspector/BuilderInspectorStyleFields.cs:531)
Unity.UI.Builder.BuilderInspectorLocalStyles:Refresh() (at Library/PackageCache/com.unity.ui.builder@0.9.0-preview/Editor/Builder/Inspector/BuilderInspectorLocalStyles.cs:130)
Unity.UI.Builder.BuilderInspector:RefreshUI() (at Library/PackageCache/com.unity.ui.builder@0.9.0-preview/Editor/Builder/Inspector/BuilderInspector.cs:413)
Unity.UI.Builder.BuilderInspector:SelectionChanged() (at Library/PackageCache/com.unity.ui.builder@0.9.0-preview/Editor/Builder/Inspector/BuilderInspector.cs:441)
Unity.UI.Builder.BuilderSelection:NotifyOfSelectionChange(IBuilderSelectionNotifier) (at Library/PackageCache/com.unity.ui.builder@0.9.0-preview/Editor/Builder/BuilderSelection.cs:266)
Unity.UI.Builder.BuilderSelection:Select(IBuilderSelectionNotifier, VisualElement) (at Library/PackageCache/com.unity.ui.builder@0.9.0-preview/Editor/Builder/BuilderSelection.cs:146)
Unity.UI.Builder.BuilderExplorer:ElementSelected(VisualElement) (at Library/PackageCache/com.unity.ui.builder@0.9.0-preview/Editor/Builder/Explorer/BuilderExplorer.cs:128)
Unity.UI.Builder.ElementHierarchyView:OnSelectionChange(List`1) (at Library/PackageCache/com.unity.ui.builder@0.9.0-preview/Editor/Utilities/ElementHierarchyView/ElementHierarchyView.cs:418)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
I’m not really sure what it originates from, to solve it I checked what selections in World UI that gave error to console, and removed their content. I had to redo those parts again, made some changes to it as well. The diffs are appended as well.
(edit: Uploaded with both old and fixed version)
(edit2)
Nevermind the fix, it seems when I added the fixed code again it still breaks.^^
(edit3)
The most annoying thing about this is that the UI Builder doesn’t seem to reload when you reopen it/create new and open, but you need to restart the whole Unity Project for it to properly reload.
(edit4)
It seems to be related to “display: none;” or/also flex
I tried to divide an concor fix the issue. When I thought I had found it, removed the issue, the next day the same error was back. So I don’t really think there is anything wrong with our code? more likely something with unity’s parser?
Yeah, this is the problem I have with UI Builder rn, and probobly editorWindow works the same, it doesn’t fully reload until you restart Unity? Or maybe it is combination to it crashing in parser first. So what you need to do after each “divide” in your divide and conquer, is to restart unity and see if it fixed it. But as I said in my edit, it seems to be fixed by not using any “display” enums. (So what I’m planning to do is to set these on start in the code instead)
Don’t understand how to use FogBugz, and haven’t seen it on the issuetracker yet. Any update on when the issue will be fixed? Added a zip with the simplest case, last tested in 2019.3.0f3 with version 0.10.0 .
This was a bug that was fixed in the last release of the UI Builder package. Can you update to UI Builder 0.10.0-preview and let me know if the bug still persists?
I can’t seem to find 1.10.0-preview, you sure it’s correct version? Latest I find is 0.10.0 which was released dec 13? Or do I need to add something more to manifest file?
I tried 0.10.0 and it still gives bug.
Create new xml, add selector, add visual element(optional?), on selector click display:none, save. Close unity, reopen project, click on selector => error.
I’m also seeing this in Unity 2018 when trying to backport UXML files from 2019. Everything seems to work but I get those messages (all of them at once):
Is there a documentation somewhere on how types have changed between 2018 and 2019? Seems e.g. flex-grow was a float and now is an enum, or wordWrap which was a bool and now is a whiteSpace enum. My guess is that this causes the above errors…
Thank you, this is exactly what I was looking for.
Even if Unity does not support that, clients still expect support for at least the last major LTS version
(and to be fair, it’s kinda working with only chaning the namespaces but those errors that feel more like warnings)
The API was under the Experimental namespace which was a warning that it should not be used for production. Experimental features are not guaranteed to be supported, even as part of LTS.
But we’ll do our best to help with information and suggestions for workarounds to help you make it work for your case. Just don’t expect any feature backports or even bug fixes.
I totally understand! And that wasn’t really meant as critique, only as a business reality, experimental namespace or not.
We build great tools with the great features on 2019 - customers want them but enough of them still use 2018 LTS - we need to find ways to make that happen.
On the note of helping with that - is there any way to debug loading an UXML that gives more info than just “Trying to read value…”? Like, can I somehow figure out which values are causing those issues, by manually stepping through it or so?
There is but it’s only available in later versions of 2019 and will not be backported. Best I can suggest is to comment out sections of the UXML/USS until it works and then work backwards to see which tags/properties it doesn’t like.
I’m getting a similar error in Unity 2020.2.0b9.3373 with UI Toolkit 0.13.0-preview. I’m not using UI builder. Is it the same error, can I provide some extra information or something else?
Trying to read value of type Color while reading a value of type Keyword
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
Same for me. UXML look fine, USS looks fine. no 'NaN’s or something like this. Unity 2022.1.8f1
the error message is crap btw. Even if you can’t fix the issue, please improve the error message to show at which line and column the parsing fails. or at least which style property. I mean: if it is already expecting a color value to be read, then it should have already parsed the style name!?
the error appears for me when playing. and the UI looks fine.
(I use multiple UXML files and stick them together at runtime, but this is the only one that contains inline styles)
also: the error appears not always but about 80% of the time this menu opens (and sometimes when it closes)
edit: I’ve had a “background-color: none;” in my USS file, to get rid of the default Button style.
It worked as in: there was no background. Solved it by setting it to transparent “rgba(0, 0, 0, 0)”.