InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

[0.9.0][Linux] 'SwitchProControllerHID' could not be found

Open SKroell opened this issue 7 years ago • 8 comments

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?)

SKroell avatar Jul 22 '19 16:07 SKroell

I can confirm this bug. It prohibited me from compiling for Linux

SolAZDev avatar Aug 04 '19 18:08 SolAZDev

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.

SKroell avatar Aug 04 '19 18:08 SKroell

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?

SolAZDev avatar Aug 04 '19 18:08 SolAZDev

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

SKroell avatar Aug 04 '19 18:08 SKroell

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.

stefanunity avatar Aug 05 '19 13:08 stefanunity

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;

image

basemmerink avatar Jul 31 '22 16:07 basemmerink

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?

Ed-Gilmour avatar Feb 05 '25 07:02 Ed-Gilmour

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.

Fernando-S avatar Feb 27 '26 15:02 Fernando-S