We have recently begun the process of updating out app from React Native 0.72.5
to 0.73.1
, however currently whenever I try and buily the app locally on my M1 Macbook Pro using XCode, the build fails within seconds with the following hermes-engine
error:
Command PhaseScriptExecution failed with a nonzero exit code
I have done a lot of Googling around this error and the consensus seems to be this will be related to the change in node
version (we were previously running 16.20.0
but we have now updated the version to 18.18.2
). We manage our node
versions using nvm
and I have set the default on my machine to the same version using the app by running nvm alias default 18.18.2
, so XCode should be using the correct node
version. I have cleared out the Derived Data folder, run a clean build etc. and no matter what, I still get the same error.
Any ideas on what I’m doing wrong here? Is this issue definitely still related to the node
version and if so, how can I fix the issue? Thanks.
2
Answers
There could be multiple reasons for iOS build failures.
This also worked for me:
Courtesy of:
https://github.com/facebook/react-native/issues/42221#issuecomment-1895955415