Makwan Barzan
Makwan Barzan

Reputation: 394

Xcode 13.2 command PhaseScriptExecution failed with a nonzero exit code

While building my project, I get this error:

line 2: /usr/local/bin/carthage: No such file or directory. Command PhaseScriptExecution failed with a nonzero exit code

Tried so many methods to resolve this issue, including switching Xcode versions. It's worth to mention that it only occurs on an M1 Mac device which I'm currently using, same project without changing any part of the configurations works on an Intel Mac.

enter image description here

Upvotes: 4

Views: 24484

Answers (2)

TimothyBuktu
TimothyBuktu

Reputation: 2116

I had a similar error. My issue was that I didn't have a ~/.bash_profile. Creating an empty file fixed the error

Upvotes: 1

Florian Friedrich
Florian Friedrich

Reputation: 841

The project is using Carthage, which is likely installed using Homebrew. On M1 Macs, Homebrew links its binaries into /opt/homebrew/bin while on Intel Macs, they are linked into /usr/local/bin.

This means that on an M1 Mac, Carthage is probably found at /opt/homebrew/bin/cartage.

Your build script should use something like $(which carthage) or simply carthage instead of relying on an absolute installation path.

Upvotes: 9

Related Questions