I want to create package and access him though Package Manager β Add package from git URL. To build package i use local project and create folder with package.json file inside ProjectName/Packages (as said in this instructions). And i want to use UI elements, so I create some layout in UI Builder and then try to save it in ProjectName/Packages/PackageName, then I get null ref 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@1.0.0-preview.18/Editor/Utilities/VisualTreeAssetExtensions/VisualTreeAssetExtensions.cs:44)
Unity.UI.Builder.BuilderDocumentOpenUXML.PostSaveToDiskChecksAndFixes (System.String newUxmlPath, System.Boolean needsFullRefresh) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.18/Editor/Builder/Document/BuilderDocumentOpenUXML.cs:1069)
Unity.UI.Builder.BuilderDocumentOpenUXML.SaveNewDocument (UnityEngine.UIElements.VisualElement documentRootElement, System.Boolean isSaveAs, System.Boolean& needsFullRefresh, System.String manualUxmlPath) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.18/Editor/Builder/Document/BuilderDocumentOpenUXML.cs:523)
Unity.UI.Builder.BuilderDocument.SaveNewDocument (UnityEngine.UIElements.VisualElement documentRootElement, System.Boolean isSaveAs, System.Boolean& needsFullRefresh, System.String manualUxmlPath) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.18/Editor/Builder/Document/BuilderDocument.cs:282)
Unity.UI.Builder.BuilderToolbar.SaveDocument (System.Boolean isSaveAs) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.18/Editor/Builder/Toolbar/BuilderToolbar.cs:368)
Unity.UI.Builder.BuilderToolbar.b__44_5 (UnityEngine.UIElements.DropdownMenuAction a) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.18/Editor/Builder/Toolbar/BuilderToolbar.cs:500)
UnityEngine.UIElements.DropdownMenuAction.Execute () (at :0)
UnityEditor.UIElements.EditorMenuExtensions+<>c__DisplayClass0_0.b__0 () (at <7105be432fb64891b07085914e6cd5c1>:0)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[ ] options, System.Int32 selected) (at <7105be432fb64891b07085914e6cd5c1>:0)
UI Builder saves file though, but when I try to open it I get UI Builder: Cannot load .uxml files outside the Project.
UI Builder: Cannot load .uxml files outside the Project.
UnityEngine.Debug:LogError (object)
Unity.UI.Builder.BuilderToolbar:b__44_3 (UnityEngine.UIElements.DropdownMenuAction) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.18/Editor/Builder/Toolbar/BuilderToolbar.cs:478)
UnityEditor.GenericMenu:CatchMenu (object,string[ ],int)
How then should I create package if I want to use UI Elements?
Also I wonder how to locate files in package? Absolute path doesnβt work, because no matter where is file in local project, the package will be stored inside Library/PackageCache/PackageName@, so to get package folder to locate assets?