Command PhaseScriptExecution failed with a nonzero exit code

When I am trying to create archive for iOS app I am getting this error on XCode 14.3.1 and macOS 13.4:

Command PhaseScriptExecution failed with a nonzero exit code

Before macOS system upgrade and XCode upgrade it worked properly. I have tried to downgrade XCode to 14.2 and it did not helped.

I have tried to clear build cache, clear build folder manually, update to latest cocoapods 1.12.1 and nothing helped. It is because of this line in pods frameworks script:

source="$(readlink -f "${source}")"

Only solution is commenting out this line, but it is a dirty fix. Does someone know how to fix this issue? Thank you a lot for any advise.

I literally just had this happen and after trying all of the same things, as silly as it was, quitting Xcode, reopening, and cleaning again did the trick. I hope yours is as easy. Wishing you luck.

I have tried a lot of stuff but nothing works I am stuck here. :(

anyone solve this issue?I also stuck here

Command PhaseScriptExecution failed with a nonzero exit code
 
 
Q