Recently downloaded the Xcode 11 Beta to test my app in iOS 13 and I'm running into an issue I can't seem to figure out. Builds fail every time on the [CP] Copy Pods Resources step, saying "Command PhaseScriptExecution failed with a nonzero exit code". Now I know this is the error when any run script phase fails, but usually there is some useful information provided along with this error.
Error output:
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target 11.0 --output-format human-readable-text --compile /Users/chris/Library/Developer/Xcode/DerivedData/SmartPager-dcfjsnhrgkjfeabbvafghvwsrsxr/Build/Products/Debug-iphoneos/SmartPager Sandbox.app/JSQMessagesViewController.nib
/Users/chris/Work/projectname/Pods/JSQMessagesViewController/JSQMessagesViewController/Controllers/JSQMessagesViewController.xib --sdk /Users/chris/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk --target-device ipad --target-device iphone
2019年09月06日 13:26:17.003 IBAgent-iOS[39395:514843] Incorrect screen size for <UIScreen: 0x7fb0e05245a0; bounds = {{0, 0}, {0, 0}}> in UICollectionViewData
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target 11.0 --output-format human-readable-text --compile /Users/chris/Library/Developer/Xcode/DerivedData/SmartPager-dcfjsnhrgkjfeabbvafghvwsrsxr/Build/Products/Debug-iphoneos/SmartPager Sandbox.app/JSQMessagesCollectionViewCellIncoming.nib /Users/chris/Work/projectname/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesCollectionViewCellIncoming.xib --sdk /Users/chris/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk --target-device ipad --target-device iphone
Command PhaseScriptExecution failed with a nonzero exit code
Relevant information: From what I can tell this might have something to do with a deprecated cocoapod we're using, specifically JSQMessagesViewController (7.3.5). Obviously using a deprecated library isn't great, but it builds and runs just fine in Xcode 10, so I don't know what the issue might be. In a separate project I tried just adding this pod and it throws the same error. The line about "incorrect screen size..." seems to just be a warning rather than an error, as in Xcode 10 it compiles correctly with that same line.
I've tried restarting my computer, cleaning, removing derived data, all the usual stuff. I just don't know where else to look now. Any advice would be most appreciated. Thanks!
-
1Have you checked Xcode preferences > Locations and then verified what version of the command line tools you are running? It should be 11.0CodeBender– CodeBender2019年09月06日 20:34:19 +00:00Commented Sep 6, 2019 at 20:34
-
Oh yes, that is set to 11.0Wernzy– Wernzy2019年09月06日 20:51:55 +00:00Commented Sep 6, 2019 at 20:51
6 Answers 6
As Ethan Wen commented, inside of your project (if you used Cocoapods) search for all the .xib files of JSQMessagesViewController and in the right panel at the first tab (File Inspector), look for the section 'Interface Builder Document' and change it from 'iOS 8.0 and later' to 'iOS 10.0 and later'. This worked for me in XCode 11 GM seed 2.
Comments
UPDATED
Finally, I found how to solve this issue.
- First fork the JSQMessagesViewController to your GitHub repo
- Clone the repo to your local folder
- Open
JSQMessages.xcworkspacewith Xcode11 - Open JSQMessagesViewController -> Views folder
- Click one of the xib file and set Interface Builder Document build for
iOS10.0 and Later - Set every xib files in that way.
- Push these change to your repo and
pod installthis repo
Hope this can help you :)
1 Comment
Discard local changes and try to build the project after cleaning the project. This solved the issue for me on XCode 11.
Comments
I had the same issue while adding the Firebase crashlytics into Build Phases -> Run Script.
Recently I had updated to new OS Catalina 10.15.4 and it started to cause the problem since I changed the shell from bash to zsh
So as you guessed just change your run script shell path to something like below. or /bin/zsh and it will work.
Comments
It turns out there was an error compiling one of the xib files in question that wasn't being reported. Copying the pod directly into my project started showing the issue.
Comments
I was getting this error for days using Carthage. I was able to fix it by going to Build Phases> Embed Frameworks then uncheck 'Code Sign on copy'. Then re-bootstrap with carthage bootstrap --platform iOS Then rebuild in xCode