I’m getting the following error when building my project: Command PhaseScriptExecution failed with a nonzero exit code
.
This is what I have in my [CP] Embed Pods Frameworks
:
I’ve also done a pod deintegrate
and pod install
but these frameworks continue to show in red:
I’m on Xcode Version 12.4
and my mac has an Apple M1
chip. Any thoughts as to what I could do to resolve this error?
4
Answers
Clearing the Excluded Architectures solved the issue. I originally had
arm64
andx86_64
excluded.Did you solve your issue?
I got the one of solutions.
(click Xcode -> product -> clean build folder)
(click Xcode -> product -> archive)
If you don’t use M1, then you have to exclude architectures "arm64".
That’s it.
Hope it works.
if you’re using nvm make sure you don’t have another globally installed version of Node/npm.
If you aren’t sure whether or not you have a global version, go to your bash_profile/zshrc and comment the three nvm initialization lines (export NVM_DIR="$HOME/.nvm" […]), then open a new terminal and do node –version, if it still finds something it means that you have a global version somewhere, and you can find its path with which node.
In my case I’m using Homebrew, and I had a global version of Node that I wasn’t even aware coming from the yarn formula, I discovered it after running brew uses –installed node. I went ahead and uninstalled yarn using
brew uninstall --force yarn
, which automatically uninstalled its node/npm dependency, then uncommented the nvm initialization lines, and then I reinstalled yarn using nvm’s npm with npm i -g yarn, and now everything works.Another way, after installing node via
brew install node
RUNsudo ln -s /opt/homebrew/bin/node /usr/local/bin/node
restart xcode and try to build again.