[0.9.0][Linux] 'SwitchProControllerHID' could not be found
When trying to build a project for Linux, it fails with the error:
Library\PackageCache\[email protected]\InputSystem\Plugins\Switch\SwitchSupport.cs(26,40): error CS0246: The type or namespace name 'SwitchProControllerHID' could not be found (are you missing a using directive or an assembly reference?)
I can confirm this bug. It prohibited me from compiling for Linux
I can confirm this bug. It prohibited me from compiling for Linux in a Game Jam
As a temporary solution (where you don't need switch support), you can get rid of it by simply commenting out that bit of code.
I can confirm this bug. It prohibited me from compiling for Linux in a Game Jam
As a temporary solution (where you don't need switch support), you can get rid of it by simply commenting out that bit of code.
~~Mind telling me where to comment?~~ EDIT: Opened the SwitchSupport.cs and commented everything inside Initialize(), is this the correct area to comment?
In (Project Root)\Library\PackageCache\[email protected]\InputSystem\Plugins\Switch\SwitchSupport.cs comment out line 26-30.
Should look like this:
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WSA
// InputSystem.RegisterLayout<SwitchProControllerHID>(
// matches: new InputDeviceMatcher()
// .WithInterface("HID")
// .WithCapability("vendorId", 0x57e) // Nintendo
// .WithCapability("productId", 0x2009)); // Pro Controller.
#endif
Hello, we can reproduce this and converted it into an internal case. It will show up at https://issuetracker.unity3d.com/product/unity/issues/guid/1174421/ soon.
This feels super related so instead of making a new issue I decided to revive this one. If this is inappropriate please let me know, and I'll create an issue the regular way.
It seems like this issue has resurfaced again, though in this case it's an entire namespace that can not be found. This occurs only when building for Linux. Windows (x32 and x64) and MacOS work fine. I am building on a Windows 64 bit machine.
This is in Unity 2021.3.7f1, Personal edition Input System Version 1.3.0 - January 05, 2022
The line that is failing using UnityEngine.InputSystem.Switch;

I'm having the same issue, I can't build my game for Linux because of this and it should work because switch controllers are supported on Linux. Are there any updates on this?
Confirmed that The type or namespace name 'Switch' does not exist in the namespace 'UnityEngine.InputSystem' (are you missing an assembly reference?) still happens when building Addressables (which happens when building the game itself) for Linux and for Web on a Windows machine.