Closed keilwastaken closed 2 years ago
Hi,
Thanks for the bug report!
Could you please add more info?
For now, I would recommend updating your packages to verified versions. For Unity 2020.3 they are:
I was able to reproduce the error with Unity 2021.3.4 and Input System 1.3.0. I'm currently investigating what's causing it. It seems like that error is only displayed when the 'Window/Analysis/Input Debugger' is open. The stack trace is coming from the Input System package:
ArgumentException: Layout name cannot be null or empty Parameter name: layoutName UnityEngine.InputSystem.Editor.EditorInputControlLayoutCache.TryGetLayout (System.String layoutName) (at /Users/kirill/Documents/projects/InputSystem/Packages/com.unity.inputsystem/InputSystem/Editor/EditorInputControlLayoutCache.cs:83) UnityEngine.InputSystem.Editor.EditorInputControlLayoutCache.GetIconForLayout (System.String layoutName) (at /Users/kirill/Documents/projects/InputSystem/Packages/com.unity.inputsystem/InputSystem/Editor/EditorInputControlLayoutCache.cs:171) UnityEngine.InputSystem.Editor.EditorInputControlLayoutCache.GetIconForLayout (System.String layoutName) (at /Users/kirill/Documents/projects/InputSystem/Packages/com.unity.inputsystem/InputSystem/Editor/EditorInputControlLayoutCache.cs:176) UnityEngine.InputSystem.Editor.InputDebuggerWindow+InputSystemTreeView.AddDevices (UnityEditor.IMGUI.Controls.TreeViewItem parent, System.Collections.Generic.IEnumerable`1[T] devices, System.Int32& id, System.Int32 participantId) (at /Users/kirill/Documents/projects/InputSystem/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDebuggerWindow.cs:688) UnityEngine.InputSystem.Editor.InputDebuggerWindow+InputSystemTreeView.BuildRoot () (at /Users/kirill/Documents/projects/InputSystem/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDebuggerWindow.cs:545) UnityEditor.IMGUI.Controls.TreeView+TreeViewControlDataSource.FetchData () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControlDataSource.cs:53) UnityEditor.IMGUI.Controls.TreeViewDataSource.ReloadData () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewDataSource.cs:54) UnityEditor.IMGUI.Controls.TreeView+TreeViewControlDataSource.ReloadData () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControlDataSource.cs:25) UnityEditor.IMGUI.Controls.TreeViewController.ReloadData () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:371) UnityEditor.IMGUI.Controls.TreeView.Reload () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControl.cs:114) UnityEngine.InputSystem.Editor.InputDebuggerWindow.OnGUI () (at /Users/kirill/Documents/projects/InputSystem/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDebuggerWindow.cs:201) UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at /Users/bokken/buildslave/unity/build/Editor/Mono/HostView.cs:448) UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:387) UnityEditor.DockArea.OldOnGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:378) UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:351) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
I was able to find and fix the issue! The plugin creates a native XRInputSubsystem without registering any layout for it. And if there is no layout registered for an input device, the 'Input System/Input Debug' window will throw this exception. While, technically, adding an input device without a registered layout is not a mistake (because Unity will it in Input System 1.4.0), I will register a layout for my XRInputSubsystem to prevent the error from the Input System.
Please update the plugin to version 1.4.23-release.0/2.0.23-release.0 for the fix.
Also, I found this Input System's commit that addresses the issue from Unity's end. It should be available in Input System 1.4.0.
Describe the bug When I hit play while using the new Unity Input System version 1.2 It throws argumentNullExpection:Value cannot be null, Parameter name: layoutName.
I have been able to confirm that the layout system works until I activate AR Foundation Remote in the XR PluginManagement window.
Please provide additional info
Android
Errors, warnings, and stack traces Add errors/warnings from the Unity Editor and from the AR Companion if any. Please send errors and warnings as text, not as screenshots (you can select all console output by pressing ctrl/cmd+a, then copy it by pressing ctrl/cmd+c). If the Editor is crashing with the plugin, please attach your Editor.log file. You can find it here.