error: unable to spawn process (Argument list too long) in Xcode Build

后端 未结 11 2004
一生所求
一生所求 2021-01-11 10:10

I am getting this error:

\"error: unable to spawn process (Argument list too long)

** ARCHIVE FAILED **

The following build co

11条回答
  •  迷失自我
    2021-01-11 10:55

    Error - unable to spawn process (Argument list too long)

    There are many reason for this error. Some of these are mentioned below:

    • Your project might have many swift files (say more than 2000)
    • Most of the Swift source files may be deeply nested inside directories

    • Many of these files have absolute paths with more than 150 characters (eg. /Macintosh HD⁩/⁨Users⁩/jayprakashnd⁩/⁨mySampleProject/Module1…)

    Xcode swift complier takes the absolute paths of all source files while so compiling, the ARG_MX limit is reached and build fails.

    This has been fixed in Xcode 11 wherein a flag is used to set unlimited number of swift files.

    Solutions:

    1. Switch to Xcode 11 and add USE_SWIFT_RESPONSE_FILE to YES in build settings - User Defined Section

    2. If you cannot switch to Xcode 11 then take a new checkout of your project in Macintosh HD⁩ ▸ ⁨Users⁩ directory with folder name as minimal as possible.

    Solution 2 worked for me like a charm!

提交回复
热议问题