microsoft / gdk-unity-package

The Unity package for PC GDK developers.
Other
51 stars 18 forks source link

Build settings can cause release build with il2cpp crash at startup #66

Closed MaartenDeMeyer closed 2 years ago

MaartenDeMeyer commented 2 years ago

We've had an elusive crash at startup happen, only for our gamecore release builds and only for il2cpp - development builds were fine & threw no exception, mono backend was OK too.

After some searching it seems this is caused by the logic in ImportWin32BuildSettings. There, the BuildOptions are built from the EditorBuildSettings, copying over flag by flag, removing setting of these flags fixes our issue.

My working theory is that this method should NOT copy over certain development only settings (such as AllowDebugging, WaitForPlayerConnection etc, unless the Development buildoption is checked. In the UI these settings are greyed out, but their values are still set. [Alternatively there might be an issue with one of the individual flags - eg enableHeadlessMode is obsolete.]

payzer commented 2 years ago

Thank you so, so much for letting us know about this elusive issue. We will investigate and get this fixed.