EDIT:
A day later I can share one more thought. While the git cloning works, the problem resurfaces after I make some changes. Which makes me wonder if the problem comes from a bad file formatting (like non unix-like EOF or similar) or just a bug in Xcode. Anyways, my workflow currently is as follows:
1) git clone to another directory
2) archive
3) if there is an error, I need to fix it,
4) git commit & git push
5) repeat steps 1 & 2 ...
Which is bothersome, but it's the only way I can archive my project and actually upload it to the App Store...
ORIGNAL POST:
I have encountered this error as well. My project uses CocoaPods, multiple targets and build schemes as well as group entitlements. At times I can't build, although this is fixable (see below) but the problem with archiving persited for a longer time. After two days of fighting with it, my summary is as follows:
I have followed all the responses and I can see that sometimes doing:
1) clean project
2) (optional - not alwys needed) restart Xcode
3) delete derived data folder contents
allows me to compile and run the App. But I still can't archive. Sometimes it seems that I have to do it twice.
Apart from the above, I have tried (and failed to archive) the following suggestions:
- rename the target names (and containing folders) to NOT include whitespaces, the Extension and WatchApp targets doesn't have whitespaces in their respective names, but the project won't archive (no change)
- I have checked that there's no embedded binaries in the Extension Target (watchApp don't have this option)
- I have tried changing the deployment target (default was iOS 8.3 for Xcode 6.4) to both 8.2 and 8.4 with no luck in archiving.
- I have recreated the AppIDs and all the provisioning profiles for both "adHoc" and "release schemas", no luck either.
- and I have verified that the current schema I'm trying to archive doesn't have whitespaces, but it still doesn't change anything.
- I have even tried the last suggestion, i.e. changing the default Derived Data folder location but, as I have suspected, it haven't changed anything.
Interestingly, what actually HAVE WORKED is the suggestion from Mike Manh: checking out the repo to another folder.
After cloning the repo to a new empty folder, everything suddenly started working. This leads me to the conclusion that there might be some leftover files/broken links/whatever in my current project folder. I guess this could've happen when I was trying to rebase my watchKit development branch into the current master branch. Which started trowing me some crazy conflicts and I have finally aborted the rebase. Possibly it was the point when the archive option ceased to function normally.
"warning: skipping copy phase strip, binary is code signed"
x 3). – CoplandWarning: Is a directory
. – Copland