Search Issue Tracker

By Design

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&)

  1. 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)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.