Xcode 12.1 Command PhaseScriptExecution failed with a nonzero exit code

Working with Catalina : 10.15.7
Xcode 12.1 (12A7403)

Everything has been working fine, then quite randomly I started getting this error, I have not been changing any script or build settings, just writing Swift code.

Then I get this error. With this message

Code Block
/bin/sh -c /Users/paul/Library/Developer/Xcode/DerivedData/MyApp-dvgzffodquwdbzcirkguqcsshyys/Build/Intermediates.noindex/Foliobook.build/Debug-iphoneos/MyApp.build/Script-DA29D50E1BFDDC03008D6B47.sh
The file couldn’t be saved.
Command PhaseScriptExecution failed with a nonzero exit code
The file couldn’t be saved.


I've tried the obvious things, removing derived data, checking that the disk has enough space (64Gb) restarting Xcode, restarting the machine. Locking and unlocking the keychain. Sacrificing a small mammal to the swift gods... still no change

The message 'the file couldn't be saved' makes me think of permissions or some kind of resource limitation, but I don't know which file is being referred to. I also get after this

Code Block
Generate MyApp.app.dSYM 1.2 seconds

Which implies the output was created.




I looked in the script file and it was a Carthage copy-frameworks command.

For some reason the problem with Carthage and Xcode 12 bug has bitten here suddenly late on Friday when I just had three lines of code to do to finish a major feature.

If I can't resolve it, then its time to repackage the module I'm using for Swift Package Manager
Xcode 12.1 Command PhaseScriptExecution failed with a nonzero exit code
 
 
Q