Error Whilst Compiling App

Sorry to bother you people but i am having a nightmare of a time getting my app on the app store.

I have followed the user guide perfectly and my app works fine on my testing device but i am now on page 53 and i am having problems.

When i try and change my Code Signing settings to distribution i get this message appearing at the bottom of window. "The name (“common name”) of a valid code-signing certificate in a keychain within your keychain path. A missing or invalid certificate will cause a build error. [CODE SIGNIDENTITY]"

Also when i try and build for distribution i get 1 failed message "Code Sign error: a valid provisioning profile matching the application's Identifier '59R497CZ5Y.com.markmckie.ccna' could not be found"

I have added all the certificates and provisioning profiles to my keychain and xcode.

I also phoned apple support and they said to revoke all my certificates and redo the whole thing but keep getting the same errors every time.

I would be very grateful if someone could help me out.

Thank You

IMac 24", Mac OS X (10.6.1)

Posted on Nov 2, 2009 2:00 PM

Reply
2 replies

Nov 8, 2009 5:59 AM in response to NSeven

Apple's instructions for provisioning are poor. It took me days to work out what was required.

If you are having problems getting your app to build and run on your iPhone or iPod touch, the following may help you:

CERTIFICATES

All certificates have to be included in the 'login' Keychain (section) of the 'Keychain Access' app, which is used to manage all types of security on your Mac. There are other sections in Keychain Access; on my MacBook these are 'System' and 'System Roots'. Ignore these, and ensure that the 'login' section is the default section. The default section shows up in bold typeface. If 'login' is NOT in bold, but some other section is, you can make 'login' the default section by right-clicking it, and selecting 'Make Keychain "login" Default'. Some developers have reported that their default keychain is automatically (and inexplicably) switched to something other than 'login'.

You need to have, in your login section of Keychain Access, the following 2 certificates:

1. A certificate called 'Apple Worldwide Developer Relations Certification Authority'. Apple also calls this the WWDR intermediate certificate. You need this certificate on your keychain (i.e. on your Mac, and available to Xcode) because this is the trusted certificate that signs your own developer certificate.

2. Your own developer certificate, which has been signed by the WWDR certificate. Your developer certificate is the one that Xcode needs. Xcode will read in this certificate when it builds your iPhone application, and because your certificate has been signed by the WWDR certificate, Xcode needs access to the WWDR certificate too, which is why it must be on your keychain.

(Note that the pair of keys (e.g. Joe Bloggs, private key, and Joe Bloggs, public key) that were created when the CSR was created, are no longer needed. You can safely delete these two files from Keychain Access after you have added your developer certificate to Keychain Access. The keys were only needed to authenticate your developer certificate from Apple.)

ERRORS

Errors you may get:

Error: "A valid signing identity matching this profile could not be found in your keychain"

Solution: Most likely that you have not downloaded the necessary WWDR certificate from the Apple developer site. There is a link to download this certificate in the 'Certificates' section of the developer portal. If you do have the certificate in your keychain, make sure that it has not expired (unlikely, as mine is valid until 2016). Also make sure that your developer certificate has not expired (these seem to be valid for only 12 months at a time).

Error: "Code Sign error: A valid provisioning profile matching the application's Identifier (abcdef123456.com.yourdomain) could not be found"

Solution: remove "abcdef123456." from the start of the Bundle Identifier in Xcode (.plist file)

Error: nothing happens when I click a button on the Apple site

Solution: DO NOT USE Firefox for visiting Apple's Developer sites. There are problems when you click buttons, e.g. to Add, Delete or Edit items in your program portal (nothing happens in Firefox), leaving you uncertain about whether anything has happened. Apple's own browser, Safari, works properly. I have not tried any other browser, but beware!

CSR COMMON NAME

When you create your CSR, the "common name" that you specify must match your own name, or the name of one of your development team that you have specified in the portal. Apple appears to add the prefix "iPhone Developer: " to the common name, and adds a 10-character suffix in parentheses, e.g. (CXW34YTRE4), but all you need is the developer's first and last name.

STARTING FROM SCRATCH

If all else fails, START OVER:

1 Delete the WWDR certificate and your developer certificates from Keychain Access
2 Ensure that the login keychain is set as the default keychain in Keychain Access
3 Download the WWDR certificate and add it to your keychain in the login section
4 Use Keychain Access to generate a CSR (Certificate Assistant... Request a Certificate...) for a developer
5 Submit the CSR to the Apple portal
6 When the developer certificate is ready, download it to your Mac and add it to your keychain in the login section
7 In the Apple portal, specify the unique device ID (UDID) of your iPhone or iPod touch. You can find the device's UDID in the Window... Organizer section of Xcode. The ID is the 40 character "Identifier" string in the "Summary" tab (e.g. 4ada8edc85bfdd3947696cb3277a8c7f731fb6c3)
8 In the Apple portal, choose an App ID name. This can be anything, it is not related to any other data. However, the Bundle Identifier that you choose here MUST match the Bundle Identifier used in your Xcode .plist file, e.g. "com.mydomain"
9 In the Apple portal, create a provisioning profile. The 3 ingredients for this are the name(s) of your developer certificates, your unique device ID(s) (UDID(s)), and your App ID. When you download this file, it will have a .mobileprovision extension. After you have downloaded it, open it in Finder, and drag it to the Xcode icon in your dock. The profile should now appear in Xcode. To check, go to the Xcode "Window... Organizer" menu and look under "iPhone Development... Provisioning Profiles". If all is ok, you should not see any yellow error messages, and your profile should appear in the "Name" list.
10 Do a clean build, so that previous precompiled headers and object files are deleted. In Xcode, choose "Build... Clean All Targets", then "Build... Build and Run". If your code compiles with no errors, Xcode will upload the app to your iPhone or iPod touch, using the USB cable attached to your device.

Message was edited by: lemonrock

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Error Whilst Compiling App

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.