Home > Net >  Xcode/iOS/RN - Lots of random/intermittent build failures after moving from Intel/Big Sur to M1/Mont
Xcode/iOS/RN - Lots of random/intermittent build failures after moving from Intel/Big Sur to M1/Mont

Time:03-02

I've got an iOS React Native project which is encountering build issues after moving from an Intel Mac with Big Sur to an M1 Mac with Monterey.

The problems appears spontaneously and randomly in unrelated components. Sometimes, but very very rarely, changing nothing and starting the build again will make them go away.

Sometimes cleaning derived data / cleaning build folder / re-launching Xcode makes the build problem go away, but often doesn't. Sometimes have to do this build/re-launch Xcode sequence several times before the build error will go away.

Running the same project with the same version of Xcode on the old laptop doesn't have these issues, its something specific to an M1 and/or Monterey (tried with Monterey v2.0.1 and v2.2.1).

Here's an example of the build issue that can just arise out of nowhere for no reason:

/Users/me/Library/Developer/Xcode/DerivedData/MyProject-dgyskfgwiispgibvghbrmmwksqza/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/FBReactNativeSpec.build/Script-5F4C70EF7D90A5A5BDAEB404279F232A.sh: line 60: 21475 Killed: 9               "$NODE_BINARY" "$CODEGEN_CLI_PATH/lib/cli/combine/combine-js-to-schema-cli.js" "$GENERATED_SCHEMA_FILE" $JS_SRCS
Command PhaseScriptExecution failed with a nonzero exit code

What could be a cause/solution?

CodePudding user response:

Make sure you force close Xcode and go to Applications and find Xcode then right click -> Get Info and enable Open using Rosetta as image below: click here

then try:

  • sudo rm -rf node_modules
  • npm install
  • cd ios && sudo rm -rf Pods
  • pod install
  • Delete derived data

run Xcode and try to start your project :)

  • Related