1
votes

I'm having difficulties building a project that relies on a number of dependencies managed by Carthage. Carthage updateruns without issues (although it has to rebuild a couple of the libraries as I'm using a more current version of swift) but problems arise during the 'copy frameworks' script (/usr/local/bin/carthage copy-frameworks) during build. Xcode fails to build the project with a rather odd error message.

Cartfile:

github "ReactiveX/RxSwift"
github "RxSwiftCommunity/RxDataSources"
github "RxSwiftCommunity/Action"
github "RxSwiftCommunity/RxRealm"

github "realm/realm-cocoa"

github "Quick/Quick"
github "Quick/Nimble"

Error:

Failed to read file or folder at /Users/adrianward/Documents/Software Development/Apollo/Carthage/Build/iOS/Realm.framework

Command PhaseScriptExecution failed with a nonzero exit code

It doesn't matter which framework is referenced as an input file - the outcome is the same. I've cleared DerivedData, checked KeyChain, rebooted, etc and even build a test project from scratch with the same result. Removing the copy framework script resolves the issue

No one's had any ideas on the Carthage GitHub page as of yet. Any ideas?

2
Now I'm having the same problem. Exact same error "Command PhaseScriptExecution failed with a nonzero exit code" :-(David H

2 Answers

2
votes

Check that in your input and output file lists of the Carthage run script you don't have added any lines with spaces.

enter image description here

Should be

enter image description here

0
votes

I scrapped the project and started again which seemed to work....and then it happened again so I checked all my Carthage directories and, in some instances, the frameworks were missing. I think something occasionally goes wrong when you get Xcode to add the frameworks to the project (I've been dragging and dropping them into the project navigator) and it moves them out of the Carthage folder rather than copying them into the project. The error went away when I copied the frameworks back into the Carthage build folder.