amirbt17
amirbt17

Reputation: 611

Command PhaseScriptExecution failed with a nonzero exit code - using CocoaPods

I'm getting the following error when building my project: Command PhaseScriptExecution failed with a nonzero exit code. enter image description here

This is what I have in my [CP] Embed Pods Frameworks: enter image description here

I've also done a pod deintegrate and pod install but these frameworks continue to show in red:

enter image description here

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?

Upvotes: 8

Views: 40869

Answers (4)

AH Rahman
AH Rahman

Reputation: 1

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 RUN sudo ln -s /opt/homebrew/bin/node /usr/local/bin/node

restart xcode and try to build again.

Upvotes: 0

Shehan Wijesinghe
Shehan Wijesinghe

Reputation: 11

  1. clear all files inside Library/Developer/Xcode/DerivedData/
  2. List item clean & build again from xcode

Upvotes: 1

Ian Kim
Ian Kim

Reputation: 21

Did you solve your issue? I got the one of solutions.

  1. First of all, you have to delete the files which are red of iOS, Frameworks . They don't exist anymore, so you shouldn't include them to archive.
  2. then clean up your builds. (click Xcode -> product -> clean build folder)
  3. go to archive. (click Xcode -> product -> archive)

If you don't use M1, then you have to exclude architectures "arm64".

That's it. Hope it works.

Upvotes: 2

amirbt17
amirbt17

Reputation: 611

Clearing the Excluded Architectures solved the issue. I originally had arm64 and x86_64 excluded.

enter image description here

Upvotes: 15

Related Questions