Building Cordova iOS project in CircleCI

Hello,

I’m trying to make Cordova iOS project build with gym:

gym --scheme “SomeScheme”

Which fails with:
▸ Running script ‘Copy www directory’
** ARCHIVE FAILED **

The following build commands failed:
PhaseScriptExecution Copy\ www\ directory /Users/distiller/Library/Developer/Xcode/DerivedData/App-hedvcpqqxzhxsaacfpigxyttvdof/Build/Intermediates/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/Script-304B58A110DAC018002A0835.sh
(1 failure)
[23:47:20]: Exit status: 65

[!] Error building the application - see the log above

Copy www directory is a build phase command that is listed in XCode project. It is:
/bin/sh cordova/lib/copy-www-build-step.sh

Apparently CircleCI setup doesn’t like this command for some reason and I would like to understand why it happens. Has anyone encountered such an issue before? If I try to build the app with xcodebuild directly, it will execute this command just fine.

Thank you!