2020.2 + Big Sur M1: Unknown architecture when building / Architecture not defined for this platform

Hello,

I’m on an M1 Macbook Pro trying to make a local build of our game through Xcode, and getting some very strange errors from GameAssembly when I try to build/play:

/Volumes/Samsung_X5/Build/bbmacos/Il2CppOutputProject/IL2CPP/libmono/config/il2cpp-config-mono-osx.h:14:2: Unknown architecture when building!
/Volumes/Samsung_X5/Build/bbmacos/Il2CppOutputProject/IL2CPP/libmono/config/il2cpp-config-mono.h:58:10: Architecture not defined for this platform
/Volumes/Samsung_X5/Build/bbmacos/Il2CppOutputProject/IL2CPP/external/mono/mono/utils/mono-context.h:459:2: unknown type name ‘MonoContextSimdReg’

We’re using Unity 2020.2, Scripting backend is set to il2cpp, building the project for Apple Silicon and Intel. Playing / building inside Xcode does this whether the target is My Mac or My Mac (Rosetta). Xcode 12.3.

Not sure how to proceed, nothing about any of this on Google…
Thanks for your help!

Hey, this is a known issue that we’re fixing. This happens specifically when building for Apple silicon with scripting debugging and IL2CPP. Changing either one of those factors will work around the bug. I’m trying to figure out when the fixing is coming out.

I just ran into this one too. Thanks for the heads up @Tautvydas-Zilys - I can confirm that removing the BuildOptions.AllowDebugging flag from buildOptions makes it possible to build for Apple Silicon in 2020.2.5f1. Thank you!

Ben

This does work, thank you.

What about profiling the build in the editor? I have Autoconnect Profiler on, and while the build works, the profiler and console don’t see it like with, say, an iOS build.

As long as you have development build checkbox checked, the profiler should be able to connect. If it doesn’t connect, did you try connecting via IP manually?

By the way, script debugging actually has negative impact on profiling, since it will make your code execute significantly slower. You should profile with it disabled.

Lastly, looks like a fix for this landed to 2020.2.6f1 which just got released today!