4

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!

2
  • 1
    Have you checked Xcode preferences > Locations and then verified what version of the command line tools you are running? It should be 11.0 Commented Sep 6, 2019 at 20:34
  • Oh yes, that is set to 11.0 Commented Sep 6, 2019 at 20:51

6 Answers 6

7

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.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

6

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.xcworkspace with 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 install this repo

Hope this can help you :)

1 Comment

Unfortunately this didn't help
1

Discard local changes and try to build the project after cleaning the project. This solved the issue for me on XCode 11.

Comments

1

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.

enter image description here

Comments

0

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

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.