KyryloKuzyk / AR-Foundation-Remote-support

Support page for the 'AR Foundation Remote' plugin on the Asset Store
https://assetstore.unity.com/packages/tools/utilities/ar-foundation-remote-2-0-201106
9 stars 0 forks source link

'Input System/Input Debug' window throws the 'ArgumentException: Layout name cannot be null or empty' exception #4

Closed keilwastaken closed 2 years ago

keilwastaken commented 2 years ago

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

  1. Does your existing AR project work fine on a real AR device? : Yes
  2. Do example scenes included with the plugin work? If an example scene doesn't work, please include the name of a scene and any errors/warnings. Please send the errors/warnings as text, not as screenshots. Yes
  3. Plugin version. You can find it in the 'Packages/AR Foundation Remote/package.json' file.: 2.0.21- release.5
  4. Unity version. Windows/macOS/Linux? 2020.3.25
  5. Attach your 'Packages/manifest.json' file. "com.kyrylokuzyk.arfoundationremote": "file:../Assets/Plugins/ARFoundationRemoteInstaller/com.kyrylokuzyk.arfoundationremote.tgz", "com.siccity.gltfutility": "https://github.com/Siccity/GLTFUtility.git", "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", "com.unity.addressables": "1.19.17", "com.unity.ads.ios-support": "file:../com.unity.ads.ios-support-master/com.unity.ads.ios-support", "com.unity.build-report-inspector": "0.2.2-preview", "com.unity.device-simulator": "3.0.3-preview", "com.unity.editorcoroutines": "1.0.0", "com.unity.ext.nunit": "1.0.6", "com.unity.ide.rider": "2.0.7", "com.unity.ide.visualstudio": "2.0.12", "com.unity.ide.vscode": "1.2.4", "com.unity.inputsystem": "1.2.0", "com.unity.mobile.android-logcat": "1.2.3", "com.unity.postprocessing": "2.3.0", "com.unity.probuilder": "4.4.0", "com.unity.progrids": "3.0.3-preview.4", "com.unity.shadergraph": "10.7.0", "com.unity.test-framework": "1.1.29", "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.4.8", "com.unity.ugui": "1.0.0", "com.unity.vectorgraphics": "2.0.0-preview.17", "com.unity.xr.arcore": "4.1.9", "com.unity.xr.arfoundation": "4.1.9", "com.unity.xr.arkit": "4.1.9", "com.unity.xr.interaction.toolkit": "0.9.4-preview", "com.unity.xr.interactionsubsystems": "1.0.1", "com.unity.xr.management": "4.2.1", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.audio": "1.0.0", "com.unity.modules.cloth": "1.0.0", "com.unity.modules.director": "1.0.0", "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", "com.unity.modules.particlesystem": "1.0.0", "com.unity.modules.physics": "1.0.0", "com.unity.modules.physics2d": "1.0.0", "com.unity.modules.screencapture": "1.0.0", "com.unity.modules.terrain": "1.0.0", "com.unity.modules.terrainphysics": "1.0.0", "com.unity.modules.tilemap": "1.0.0", "com.unity.modules.ui": "1.0.0", "com.unity.modules.uielements": "1.0.0", "com.unity.modules.umbra": "1.0.0", "com.unity.modules.unityanalytics": "1.0.0", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.modules.unitywebrequestassetbundle": "1.0.0", "com.unity.modules.unitywebrequestaudio": "1.0.0", "com.unity.modules.unitywebrequesttexture": "1.0.0", "com.unity.modules.unitywebrequestwww": "1.0.0", "com.unity.modules.vehicles": "1.0.0", "com.unity.modules.video": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0"
  6. Press 'File/Save', then attach your 'Assets/Plugins/ARFoundationRemoteInstaller/Resources/Settings.asset' file.
  7. Your AR device model and its OS version. Please make sure your AR device supports ARKit/ARCore and supports a feature you would like to test in the Editor.

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.

keilwastaken commented 2 years ago

image

KyryloKuzyk commented 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:

KyryloKuzyk commented 2 years ago

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)

KyryloKuzyk commented 2 years ago

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.