if you are just using the simulator and just upgraded then this solved the issue for me:
go to menu->project-edit project setting.
find code signing section (you can type 'code' in the quick search)
in the code signing identity select 'any sdk' and set the value to 'Don't Code Sign'
This happens if you forgot to change your build settings to Simulator. Unless you want to build to a device, in which case you should see the other answers.
Check if you are building for device instead of simulator. Go to Xcode menu 'Project' -> 'Set Active SDK' change from 'Device' to 'Simulator'
Under Xcode 4.1
Check your build settings for the project and your targets. For each check under 'Code Signing' check 'Code Signing Identity' and change over to 'Don't Code Sign'
I 'tripped' across my solution after 2 days...XCODE 4.0
I've just upgraded to XCode 4.0 and this code signing issue has been a stunning frustrastion. And I've been doing this for over a year various versions...so if you are having problems, you are not alone.
I have recertified, reprovisioned, drag and dropped, manually edit the project file, deleted PROVISIIONING paths, stopped/started XCODE, stopped started keychain, checked spelling, checked bundle ID's, check my birth certificate, the phase of the moon, and taught my dog morse code...none of it worked!!!!
--bottom line---
Goto Targets... Build Settings tab
Go to the Code Signing identity block
Check Debug AND Distribution have the same code signing information
..in my case "IPhone Distribution:, dont let DEBUG be blank or not filled in.
If the Debug mode was not the same, it failed the Distribution mode as well...go figure. Hope that helps someone...
Figure: This shows how to find the relevant settings in XCode 4.5.
I had the same problem. I'm very new to iphone development and it was my first time trying to load my program onto my iphone. The message is correct, you need to create a certificate in the keychain. The best walkthrough is here:
Open this file (Certificates.p12) on your machine (with KeyChain),
and enter the password the other developer used when exporting. It
is now imported into your KeyChain.
Now connect iOS device and rebuild targeting the iOS device.
In XCode 4.0 main workspace, at the top left side & just after the "Stop Button", there is scheme selector, click on it and change your scheme to IPhone Simulator. That's it
I had the same problem. I was very new to iPhone development and it was my first time trying to submit my app to App-store...
Check the following :
1. Check that your current "Bundle Identifier" is same as your current "Provisioning Profile" name in "Code Signing Identity".
2. In "Code Signing identity block" - Check Debug AND Distribution have the same "Code Signing Information". Try to keep the "Code Signing Information" same in all the Blocks.
3. Try to Download the "Provisioning Profile" again and double click on the profile. Then use that newly downloaded profile in your "Code Signing Identity".
4. Try to Download the "Certificate" again from the "developer.apple.com" and double click on the certificate. (It worked in my case)
Then "Clean" the project and click on "Build for Archive".
Hope your code will be archived perfectly.
if your certificate is not valid, it will have a red "x" and state the reason why. Generally the reason is "This certificate has expired" or "This certificate was signed by an unknown authority.
to solve this you need to do the following step.
If your certificate has expired, renew it at the iPhone Portal, download it, and double-click it to add it to your Keychain.
If it's "signed by an unknown authority", download the "Apple Worldwide Developer Relations" certificate from the Certificates section of the iPhone Developer portal and double-click it to add it to your Keychain.
If your certificate was revoked, delete the certificate from your Keychain, then follow the "Obtaining your iPhone Development Certificate" or "Obtaining your iPhone Distribution Certificate" section in the iPhone Developer Program Portal User Guide to generate a new certificate.
Make sure you create a backup of your private key. The steps for doing this are described in the iPhone Developer Program Portal User Guide, under "Saving your Private Key and Transferring to other Systems".
If you have the iPhone Developer (or iPhone Distribution) certificate and its associated private key, the Apple WWDR Intermediate certificate is installed, and your certificate is valid, confirm that Online Certificate Status Protocol (OCSP) and Certificate Revocation List (CRL) are set to "Off" in Keychain Access > Preferences > Certificates.
if you still getting problem then contact support apple community.