A couple of days ago I changed laptops from an Intel/Big Sur to a MacBook Pro M1/Monterey.
Since then I've encountered endless endless problems building in Xcode (for iOS).
The very first attempt at building my project after setting up the laptop was successful, but since then builds just fail randomly without making any code changes. i.e. make a build and its successful, change nothing whatsoever and it fails.
Once a build fails it takes an eternity to get it building successfully again, doing a clean, delete derived data, quit/re-launch Xcode doesn't necessarily fix the problem, it might be necessary to do this 3 or 4 times before the build succeeds again. But that build success will only be temporary before it fails again.
The failures are different each time, but one thing they seem to have in common is a Killed: 9 message, here's an example
Script-00DD1BFF1BD5951E006B06BC.sh: line 5: 22679 Killed: 9 ../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh Command PhaseScriptExecution failed with a nonzero exit code
I've had about 6 or 7 different random failures in different places, but they all say Killed: 9 Command PhaseScriptExecution failed with a nonzero exit code.
The project used to build fine on the old laptop, its the exact same project/code, the only variable here is the laptop itself and the MacOS.
I've been struggling with this for the last 3 days, the problems are just endless. The build failures are random, like I mentioned a build will work fine one time, then just stop for no reason. They could occur at any random moment in any random component of the project or its dependencies.
Its utterly impossible to proceed like this, I'm the first in my company out of about 100 employees who are going to upgrade their laptops from Intel to Silicon. I will be telling our IT department we absolutely cannot make that switch as things are just unusable and its impossible to proceed with this combination of laptop|OS|Xcode.
I'm on Monterey 12.2.1 | Xcode 13.2.1, but the problem was also present with Monterey 12.0.1|Xcode 13.2.1
Opening Xcode with Rosetta makes no difference to the problems.