Hi.
I’m trying to create uxml and uss inside the Package folder (I want them to be part of a new package I’m creating), but when I try to save the documents inside the UI Builder, I’ve this Exception:
NullReferenceException: Object reference not set to an instance of an object Unity.UI.Builder.VisualTreeAssetExtensions.DeepOverwrite (UnityEngine.UIElements.VisualTreeAsset vta, UnityEngine.UIElements.VisualTreeAsset other) (at Library/PackageCache/com.unity.ui.builder@0.10.0-preview/Editor/Utilities/VisualTreeAssetExtensions/VisualTreeAssetExtensions.cs:41) Unity.UI.Builder.VisualTreeAssetExtensions.DeepCopy (UnityEngine.UIElements.VisualTreeAsset vta) (at Library/PackageCache/com.unity.ui.builder@0.10.0-preview/Editor/Utilities/VisualTreeAssetExtensions/VisualTreeAssetExtensions.cs:31) Unity.UI.Builder.BuilderDocument.SaveNewDocument (System.String uxmlPath, System.String ussPath, UnityEngine.UIElements.VisualElement documentRootElement, System.Boolean isSaveAs) (at Library/PackageCache/com.unity.ui.builder@0.10.0-preview/Editor/Builder/BuilderDocument.cs:457)
Am I doing something really wrong or this is a known issue?
It should definitely not explode like that, even if it doesn’t let you save. To be safe, create the UXML and USS inside your package first, and then load the UXML for editing in the UI Builder after.
There’s definitely a bug in there but I’ll need more info. Can you submit a bug report using the Help > Report a bug… menu in Unity?
Hey Damian, thanks for the reply.
The issue with doing that (which I tried already) is that while I can load the uxml, if I modify it and want to save it (which is the most common thing), it fails again.
I’m using the local referencing using “file:/” , I didn’t try by using a git one (tho the package is actually in git, but for develompent I use “file:/” instead.