Unity built executable unable connect to serial port when built with IL2CPP backend

When project is exported with Project Settings > Player > Configuration > Scripting backend IL2CPP the executable is not able to connect to the serial port that the haply device is connected to.

a IOException: The port `COM8’ does not exist. is thrown in the logs.

here is a minimum reproduction project.

Note: ensure that scripting backend is set to IL2CPP.


Just to confirm before I pass this on, could you verify in the device manager (windows key > device manager) that your device is associated with port COM8 in the Ports (COM & LPT) section? Inverse3 devices should show up with the label USB Serial Device (COM?) where ? can be any number. As an example, COM6 is my connected device:



COM12 is the haply device.
COM8 is the handle.

neither of them connect when running a build with the IL2CPP backend, but work fine when running a build with the default scripting backend.

Thank you for the confirmation. It also doesn’t look like you’re running into the issues we’ve been experiencing with wireless handles related to the Bluetooth firmware which leaves us with a potential issue at the C# API or Unity plugin level.

I’m unfortunately not the best person to field questions related to the C# API or the Unity plugin so I’ll have to defer the answer to one of my colleges.

We have so far not tested the Unity package against Unity’s IL2CPP scripting backend, so we will need to do some initial validation that IL2CPP supports the .NET API surface required by our C# API. For the moment, I would suggest using the default scripting backend.

Thanks for the reply, it would benefit us if IL2CPP can be supported as it improves performance on our scenes with voxels.