Code signing is required for product type 'Application' in SDK 'iOS5.1'

I am using xCode 4.3.1. After i created a project, i build it and tried to Archive. Then i got an error saying; (This is my first project in xCode 4.3.1)

CodeSign error: code signing is required for product type 'Application' in SDK 'iOS5.1'

What does this mean ? and how to solve it ?


It means you haven't assigned a provisioning profile to the configuration.

Usually it's because "Any iOS SDK" must have a profile and cannot be set to "Don't sign".

All this and more is answered in the TN2250 Tech Note about Code Signing and Troubleshooting.


One possible solution which works for me:

  1. Search "code sign" in Build settings
  2. Change everything in code signing identity to "iOS developer", which are "Don't code sign" originally.

Bravo!


This error was caused, for me, by different circumstances. A downloaded project tutorial had a default setting of [Project]>Targets>Build Settings>Architectures>Build Active Architecture Only>Release = "Yes." I wasn't intending to build a release, so the solution was to set Release (which presumably requires not just a developer profile but distribution profile) to "No."