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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
Fixed by https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-101232