Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 11 Beta 7 Command PhaseScriptExecution failed with a nonzero exit code ([CP] Copy Pods Resources)

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!

like image 238
Wernzy Avatar asked Dec 06 '22 09:12

Wernzy


2 Answers

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

like image 71
Yisus Avatar answered Dec 28 '22 08:12

Yisus


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 :)

like image 37
Ethan Wen Avatar answered Dec 28 '22 10:12

Ethan Wen