Search Issue Tracker
Fixed in 2022.1.X
Fixed in 2021.1.X, 2021.2.X
GUIStyle errors are thrown when entering Play mode with docked Profiler and the "Maximize On Play" option Enabled
1. Download the attached "ProfilerBug.zip" project and open in Unity
2. Open the "SampleScene" scene
3. Open Profiler window and dock it near Console or anywhere else
4. In Game View enable the "Maximize On Play" option
5. Enter Play mode
Expected Results: Everything works as Expected
Actual Results: Errors are spammed in Console:
"Unable to use a named GUIStyle without a current skin. Most likely you need to move your GUIStyle initialization code to OnGUI
UnityEditorInternal.ProfilerTimelineGUI/Styles:.ctor () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:210)
UnityEditorInternal.ProfilerTimelineGUI:get_styles () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:231)
UnityEditorInternal.ProfilerTimelineGUI:InitializeNativeTimeline () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:2673)
UnityEditorInternal.ProfilerTimelineGUI:Clear () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:1348)
UnityEditorInternal.Profiling.CPUProfilerModule:Clear () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/CPUProfilerModule.cs:92)
UnityEditorInternal.Profiling.CPUOrGPUProfilerModule:OnDisable () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPUorGPUProfilerModule.cs:308)
UnityEditorInternal.Profiling.CPUProfilerModule:OnDisable () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/CPUProfilerModule.cs:81)
UnityEditor.EditorApplicationLayout:InitPlaymodeLayout () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/EditorApplicationLayout.cs:59)"
- This issue appears both on Windows and OSX
- This issue is not reproducible when Profiler is undocked and the "Maximize On Play" option is Enabled/Disabled
- This issue is not reproducible when Profiler is docked and the "Maximize On Play" option is Disabled
- Sometimes Unity on MacOS throws different Errors:
"NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ProfilerWindow.SaveViewSettings () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerWindow.cs:682)
UnityEditor.ProfilerWindow.OnDisable () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerWindow.cs:367)
UnityEditor.EditorApplicationLayout:InitPlaymodeLayout() (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/EditorApplicationLayout.cs:59)"
"IConnectionState was not Disposed! Please make sure to call Dispose in OnDisable of the EditorWindow in which it was used.
UnityEditor.Networking.PlayerConnection.GeneralConnectionState:Finalize () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Networking/PlayerConnection/AttachToPlayerGUI.cs:373)"
Reproducible on Unity 2021.1.16f1, 2021.1.21f1, 2021.2.0b11 and 2022.1.0a8
Not reproducible on Unity 2019.4.30f1, 2020.3.18f1 and 2021.1.15f1
Regression on Unity 2021.1.16f1
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [Xcode] "InfoPlist (English)" is required when "InfoPlist (English (United States))" already exists
- [tvOS] Crash when closing the On Screen Keyboard with tvOS version <15.0
- Temporal Anti-aliasing (TAA) produces severe artifacting when quality set to Very High
- [iOS] Player crashes when using “WebCamTexture” on specific iOS devices
- [Linux][IL2CPP] Player crash call stack is not displayed when the build is run with "-batchmode -nographics" arguments