capkoh
November 30, 2019, 12:27pm
1
Hi,
I’ve decided to give a try to the new input system, but run into an issues that it does not work with Managed Stripping Level set to High . In the player I get the following exception:
Could not create a device for ‘Keyboard (RawInput)’ (exception: System.MissingMethodException: Default constructor not found for type UnityEngine.Experimental.Input.Keyboard
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x0007b] in <8043b6ef263940b8922abd7076a897e7>:0
at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in <8043b6ef263940b8922abd7076a897e7>:0
at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00027] in <8043b6ef263940b8922abd7076a897e7>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00020] in <8043b6ef263940b8922abd7076a897e7>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <8043b6ef263940b8922abd7076a897e7>:0
at UnityEngine.Experimental.Input.Layouts.InputDeviceBuilder.InstantiateLayout (UnityEngine.Experimental.Input.Layouts.InputControlLayout layout, UnityEngine.Experimental.Input.Utilities.InternedString variants, UnityEngine.Experimental.Input.Utilities.InternedString name, UnityEngine.Experimental.Input.InputControl parent, UnityEngine.Experimental.Input.InputControl existingControl) [0x0004b] in H:\Projects\Unity-UI\code\LinkingGame\Library\PackageCache\com.unity.inputsystem@0.2.1-preview\InputSystem\Devices\InputDeviceBuilder.cs:239
at UnityEngine.Experimental.Input.Layouts.InputDeviceBuilder.InstantiateLayout (UnityEngine.Experimental.Input.Utilities.InternedString layout, UnityEngine.Experimental.Input.Utilities.InternedString variants, UnityEngine.Experimental.Input.Utilities.InternedString name, UnityEngine.Experimental.Input.InputControl parent, UnityEngine.Experimental.Input.InputControl existingControl) [0x0000e] in H:\Projects\Unity-UI\code\LinkingGame\Library\PackageCache\com.unity.inputsystem@0.2.1-preview\InputSystem\Devices\InputDeviceBuilder.cs:216
at UnityEngine.Experimental.Input.Layouts.InputDeviceBuilder.Setup (UnityEngine.Experimental.Input.Utilities.InternedString layout, UnityEngine.Experimental.Input.Utilities.InternedString variants, UnityEngine.Experimental.Input.Layouts.InputDeviceDescription deviceDescription, UnityEngine.Experimental.Input.InputDevice existingDevice) [0x0002b] in H:\Projects\Unity-UI\code\LinkingGame\Library\PackageCache\com.unity.inputsystem@0.2.1-preview\InputSystem\Devices\InputDeviceBuilder.cs:67
at UnityEngine.Experimental.Input.InputManager.AddDevice (UnityEngine.Experimental.Input.Utilities.InternedString layout, System.Int32 deviceId, UnityEngine.Experimental.Input.Layouts.InputDeviceDescription deviceDescription, UnityEngine.Experimental.Input.InputDevice+DeviceFlags deviceFlags, UnityEngine.Experimental.Input.Utilities.InternedString variants) [0x00007] in H:\Projects\Unity-UI\code\LinkingGame\Library\PackageCache\com.unity.inputsystem@0.2.1-preview\InputSystem\InputManager.cs:922
at UnityEngine.Experimental.Input.InputManager.AddDevice (UnityEngine.Experimental.Input.Layouts.InputDeviceDescription description, System.Boolean throwIfNoLayoutFound, System.Int32 deviceId, UnityEngine.Experimental.Input.InputDevice+DeviceFlags deviceFlags) [0x0005e] in H:\Projects\Unity-UI\code\LinkingGame\Library\PackageCache\com.unity.inputsystem@0.2.1-preview\InputSystem\InputManager.cs:1043
at UnityEngine.Experimental.Input.InputManager.OnNativeDeviceDiscovered (System.Int32 deviceId, System.String deviceDescriptor) [0x000f9] in H:\Projects\Unity-UI\code\LinkingGame\Library\PackageCache\com.unity.inputsystem@0.2.1-preview\InputSystem\InputManager.cs:1934 )
It happens in a Windows build using Unity 2018.4.3 and InputSystem 0.2.1 . I also have keyboard added to the list of devices in the settings.
In the build with low stripping level everything works fine, but since I’m using IL2CPP and targeting fast iterations, I would like to use high stripping level to get builds faster and smaller.
Is there a way to make new input system work with High stripping level set?
Thanks!
This is fixed in a newer version of the input system (we’re now running our own project in the repo with stripping set to high). However, note that you will have to upgrade to 2019.1 in order to be able to get the fix. 2018 is no longer supported.
1 Like