Search Issue Tracker
Fixed
Votes
0
Found in
6000.0.45f1
6000.1.0b13
6000.2.0a8
Issue ID
UUM-102071
Regression
Yes
"ArgumentException" errors thrown when adding Buttons with sprites to a VisualElement that has a Label
How to reproduce:
1. Open attached “IN-98252” project
2. Open the “SampleScene” from the Scenes folder in the Project tab
3. Enter Play mode
4. Exit Play mode
5. Enter Play mode
6. Observe the Console and the Game view
Expected results: No errors thrown in the Console, buttons appear in the Game view with game pad button sprites and correlating name
Actual result: Multiple “ArgumentException” errors are thrown, buttons sometimes lack text or sprite or both
Reproducible with: 2023.2.0b4, 6000.0.45f1, 6000.1.0b13, 6000.2.0a8
Not reproducible with: 2022.3.60f1, 2023.2.0b3
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
- Errors in the Console:
> ArgumentException: An item with the same key has already been added
> ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds
- Commenting out line 15 [container.Add(new Label("This label magically breaks everything."));] in the “Test” Script, that is attached to UIDocument, fixes the issue
- “NullReferenceException” errors are additionally thrown in 6000.2.0a8 Editor version
- Changing font in “USS” Style Sheet to “FontOK” fixes the issue (does not fix in 2023.2.0b4)
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
- Light rendering artefacts appear in the Editor when assigning unsupported 3D Custom Render Texture in Camera’s Output Texture, unclearable errors and warnings spammed
- Memory leak when running a test with "GfxThreadingMode" set to "SplitJobs"
- Loading Unloaded unsaved Scene throws “ArgumentException” error in the Console
- Crash on std::__1::__tree_const_iterator when opening the Build Profiles window in a specific project
- Sub-State machine “breadcrumb trail” doesn’t fit in the window if there’s too many Sub-State machines
Resolution Note:
Fixed by https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-101232