Xcode: Build and Archive error "No such file or directory"

When I try to use "Build and Archive" in Xcode to build an ad-hoc distribution of my game, I get an alert with the error message:

The operation couldnt be completed. No such file or directory

Unfortunately it doesn't say what file or directory is missing.

Just building the game does not cause any problems, nor does "Build and Debug". How do I fix this?

I'm using Unity iPhone 1.7 and Xcode 3.2.2.

Petey on the forum provided the answer:

Open your Xcode project Select Unity-iPhone in targets (Double click so it opens the info) find "Generate Debug Symbols" and check it on. (Just Search for it in the search field)

This worked for me, but I still don't understand why it is necessary.

Petey and malcolmryan - thank you, Thank you, THANK YOU! Worked perfectly for me, after hours of frustration spent before finding your solution.

Please note that there was an issue on Apple’s side yesterday (January 16). It seems like some of the certificates that were created that day needed to be recreated. That’s what we did today, and everything is working fine again now. Also see the corresponding page on Stackoverflow.