Hi, I have multiple UXMLs created a while back, plus some created in 2021.2.4f1 (where everything works).
After upgrading editor to 2022.1.0a16, the asset import fails on many of them. Does not seem to matter which previous version they were created in.
ArgumentNullException: Value cannot be null.
Parameter name: key
Some UXMLs lose their icon and association with UI Builder (they open in IDE). Others retain the link but the builder fails to open them: UI Builder - Unable to parse UXML file.
Console details
UI Builder Failed to open Assets/Content/UIDocuments/ModPanelContainer.uxml.uxml asset. This may be due to invalid UXML syntax or UXML syntax the UI Builder does not yet support. Check console for details.
UnityEngine.Debug:LogError (object)
Unity.UI.Builder.BuilderAssetUtilities:ValidateAsset (UnityEngine.UIElements.VisualTreeAsset,string) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui.builder/Editor/Builder/Utilities/BuilderAssetUtilities.cs:77)
Unity.UI.Builder.BuilderToolbar:LoadDocument (UnityEngine.UIElements.VisualTreeAsset,bool,bool,string) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui.builder/Editor/Builder/Toolbar/BuilderToolbar.cs:385)
Unity.UI.Builder.Builder:LoadDocument (UnityEngine.UIElements.VisualTreeAsset,bool) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui.builder/Editor/Builder/Builder.cs:210)
Unity.UI.Builder.Builder:OnOpenAsset (int,int) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui.builder/Editor/Builder/Builder.cs:287)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
Note on the double “.uxml” extension in console reference: The file on drive is just single .uxml
We seem to be having this too. All GUIDs match existing USS files any nested UXMLs too, no files are missing.
Trying @razamgar 's solution to no avail.
If we’re creating local packages or over VC as soon as we try to import the UI into another project it fails with the same error as the OP.
It’s an old Post, but try updating your ‘noNamespaceSchemaLocation’ and Style ‘src’ values in your uxml files.
I just migrated my files over to the latest Unity version and the paths(I’m guessing the file id’s as well maybe?) changed, breaking the uxml validity.
Making a new UI Document and copying out the paths from the new file over to the old ones, as well as updating my custom style sheet location fixed my issues.