Besides googling for possible solutions to this problem and trying them out (hoping that they help), here is an advice how to diagnose what causes this. The steps below apply to Xcode 4.2.
- In menu, select View > Navigators > Show Log Navigator. The Log Navigator should be displayed on the left side.
- In the list of builds, select the one that causes troubles. The log from the build will be shown in the main view.
- Scroll to the very bottom. The last two steps should be CodeSign and Validate, where the Validate step contains the warning.
- Expand CodeSign and inspect the parameters used to perform the code signing.
- Expand Validate to learn more about the errors/warnings.
Also scroll up and inspect the heading for the build target:
Build Target (your build target)
Project (your project) | Configuration (selected configuration) | Destination ...
In my case, I found out that while doing the Archive build, the app was signed with the developer certificate. Inspecting the heading for the build target revealed that the Release configuration was used to build the archive. The remedy was to:
- In the menu, select Product > Edit Scheme
- In the Edit Scheme dialog, select the Archive build item (list on the left)
- Change Build Configuration to Distribution
I had this issue after duplicating a build target. The original target was signed by the distribution certificate. However, when copying the target, Xcode decided to assign the Release configuration to the Archive build.