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
- Too little validation messages in the "WebAssembly Language Features" Memory settings
- Project Settings Search Highlights are misaligned when using the Bitmap Text Rendering Mode
- "GetControlID at event ValidateCommand returns a controlID different from the one in Layout event" Warning is thrown when undoing the deletion of Sprite Shape Profile
- Memory related fields in the "WebAssembly Language Features" can be set to the negative numbers
- "WebAssembly Language Features" Header in the Player Settings has a smaller indentation
Resolution Note:
Fixed by https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-101232