I\'m having issues with archiving on my CI machine (Jenkins), when running the process manually on the SAME machine but with the Xcode UI, everything works just fine.
T
Eventually I figured it out, it's something that looks really UNRELATED, and yet it was the only thing that fixed the described issue for me.
Go to your build settings and remove any recursive search paths you have there. That's it. (any search path that ends with ** is a recursive one).
Good luck!