This issue usually happens for the Xcode projects involving Cocoapods with more dependencies during [CP] Check Pods Manifest.lock script execution.

PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/xxx/Library/Developer/Xcode/DerivedData/xxx/Build/Intermediates.noindex/\ (Staging)-iphonesimulator/ (in target 'xxx' from project 'xxx')
cd /Users/xxx/Documents/Projects/<project-name>
/bin/sh -c /Users/xxx/Library/Developer/Xcode/DerivedData/xxx/Build/Intermediates.noindex/\\\ \\\(Staging\\\)-iphonesimulator/

error: unable to spawn process (Argument list too long) (in target 'xxx' from project 'xxx')

The direct solution to fix this problem is setiing the build system to Legacy Build Sysrtem via ‘File -> Workspace Settings’

Legacy Build System could work till Xcode 11.x versions. However, with Xcode 12.x …

Badarinath Venkatnarayansetty

Senior iOS Engineer @ Intuit | Exploring, Experimenting new ways of building mobile apps.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store