Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
0
Found in
2023.2.0a17
Issue ID
UUM-36920
Regression
No
“Element 'UI.Control.CustomControl' is missing a UxmlElementAttribute and has no registered factory method” error in Console when marking an empty custom control with UxmlElementAttribute
Reproduction steps:
1. Open the “UxmlElementAttribute.zip“ project
2. Select the “Assets/Scripts/UI/Resources/UXML1.uxml“ asset
3. Open “Assets/Scripts/UI/Resources/UXML2.uxml“ in UI Builder
4. In the Library section open the Project tab
5. Drag “Custom Controls (C#) > UI > Controls > CustomControl” over “UI Documents (UXML) > Assets > Scripts > UI > Resources > UXML1.uxml“
Expected result: No UxmlElementAttribute errors in Console
Actual result: “Element 'UI.Control.CustomControl' is missing a UxmlElementAttribute and has no registered factory method” errors in Console after the 2nd and 5th steps
Reproduced in: 2023.2.0a9, 2023.2.0a17
Could not test in: 1.0.0-preview.18 (2020.3.48f1), 2021.3.26f1, 2022.3.0f1, 2023.1.0b19, 2023.2.0a8 (UxmlElement and UxmlElementAttribute not found errors)
Reproduced using: macOS 13.3.1 (Intel), Windows 10 (by the reporter)
Full error after the 2nd step:
Element 'UI.Control.CustomControl' is missing a UxmlElementAttribute and has no registered factory method.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
Full error after the 5th step:
Element 'UI.Control.CustomControl' is missing a UxmlElementAttribute and has no registered factory method.
UnityEngine.UIElements.VisualTreeAsset:CloneTree ()
Unity.UI.Builder.BuilderLibraryProjectScanner/<>c__DisplayClass9_0:<ImportUxmlFromProject>b__0 ()
Unity.UI.Builder.BuilderLibraryView:OnItemMouseEnter (UnityEngine.UIElements.MouseEnterEvent)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note:
The error is there to point out an issue with the type name used in the uxml file.
The UXML is using "UI.Control.CustomControl" when it should be "UI.Controls.CustomControl" (with a 's', like in the code)
Resolution Note (2023.2.X):
The error is there to point out an issue with the type name used in the uxml file.
The UXML is using "UI.Control.CustomControl" when it should be "UI.Controls.CustomControl" (with a 's', like in the code)