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

后端 未结 11 2000
一生所求
一生所求 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:49

    I made simple script for temporary fix that problem. https://github.com/gregoryvit/flatter

    It simply move all swift files in Xcode project to root group.

    0 讨论(0)
  • 2021-01-11 10:49

    It happened to me when I use Xcode 11 beta version using Live Preview. Then I solved it by restarting Xcode after that error has gone.

    0 讨论(0)
  • 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!

    0 讨论(0)
  • 2021-01-11 10:57

    I solved this by setting build system to Legacy build system in file-> workspace setting -> select workspace setting

    0 讨论(0)
  • 2021-01-11 10:59

    I have fixed this issue, moving my folder of My Xcode project to the mac root and changing my name Folder to less characters.

    1. Terminal: cd /

    2. Change name folder to BX (example).

    0 讨论(0)
  • 2021-01-11 10:59

    I have changed build type to legacy and it also resolved problem for me, both locally and on our CI builder. For me it was caused during checking Podfile.lock and Manifest.lock. Probably this could be skipped in our pipeline since we are always installing pods on CI.

    0 讨论(0)
提交回复
热议问题