superunitybuild/buildtool

Error because of an invalid cast during macOS builds in the Unity beta

Closed this issue · 2 comments

When making a macOS build in 2022.2.0b10, an error is thrown complaining that an implicit cast is impossible. Specifically, it happens on line 102 of BuildOSX.cs:

#if UNITY_2020_2_OR_NEWER && UNITY_STANDALONE_OSX
            UnityEditor.OSXStandalone.UserBuildSettings.architecture = (UnityEditor.OSXStandalone.MacOSArchitecture)EnumValueFromKey<MacOSArchitecture>(key);
#endif

Changing that cast to UnityEditor.Build.OSArchitecture makes everything work correctly. I guess they just changed the names of things?

Thanks for the report, it does indeed look like that setting has changed to use an enum in a different namespace in Unity 2022.2: https://docs.unity3d.com/2022.2/Documentation/ScriptReference/Build.OSArchitecture.html At least it's documented now, unlike UnityEditor.OSXStandalone.MacOSArchitecture!

I'll get this fixed in the next release of the tool.

This is fixed by #94 🎉