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
- Project window button icons are poorly visible and their shades differ in Light theme
- GC.Alloc called by HDRenderPipeline.LensFlareMergeOcclusionDataDrivenPass() when playing the default HDRP Sample Template project
- Automatic LOD fails and SRP Batcher incompatibility occurs when using spline-based quad-topology meshes
- Editor crashes on D3D12GetInterface when repeatedly enabling and disabling 256 text components
- Flickering bright white dots in the Scene when the Android Platform is selected and DX11 Graphics API is used with Iris(R) Xe Graphics GPU
Resolution Note:
Fixed by https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-101232