If you encounter the "Command PhaseScriptExecution failed with a nonzero exit code" error while compiling your Flutter project on Xcode Version 14.3, it may be due to an error in the phase execution script.
One solution is to replace the line of code: source="$(readlink "${source}")"
with
source="$(readlink -f "${source}")"
To locate the line of code to modify, you can search your Flutter project using the following keyboard shortcuts:
On Mac: "command + Shift + F" On Windows: "CTRL + Shift + F" Then, you should be able to locate the line of code "source="$(readlink "${source}")"" and replace it with "source="$(readlink -f "${source}")"". This should resolve the "Command PhaseScriptExecution failed with a nonzero exit code" error.
I hope this is helpful and easy to follow!
PS : Thanks "CSchwarz" to find the solution ! https://stackoverflow.com/a/75945651/16475983