
Tip: If you use automatic signing (recommended), Xcode repairs most code signing errors for you.
If you manually sign an app, you are responsible for managing the provisioning profile and code signing errors may occur when you build and run your app.
If you change the provisioning profile and receive the following error message:
Code Sign error: Provisioning Profile 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx' can’t be foundthe provisioning profile is wrong.
In the Signing section (located in the General pane of the project editor), verify that the team, provisioning profile, and signing certificate settings are correct.
If you manually sign an app, repeat the steps to download and import the provisioning profile.
If you set the Code Signing Identity build setting yourself, verify that the settings are correct in the Build Settings pane of the project editor.
For multiple targets that use the same signing certificate, set this build setting at the project level, not the target. If it’s set on both the project and the target, the target setting overrides the project setting. If the target’s Code Signing Identity build setting is set, delete it by first selecting it and then choosing Edit > Delete. Then set the project’s Code Signing Identity build setting to the signing certificate.
If the signing certificate or provisioning profile doesn’t appear in the Code Signing Identity pop-up menu, download and import the provisioning profile again.
To view and edit build settings, go to Configure build settings.
If Xcode can’t verify the authenticity of your development or distribution certificate, you receive a CSSMERR_TP_NOT_TRUSTED error message from the codesign(1) command-line tool.
Code Sign error: CSSMERR_TP_NOT_TRUSTEDTo fix this problem, set the trust settings for your development, distribution, and intermediate certificates to the system default.
Launch Keychain Access.
In the Category section, select My Certificates.
Double-click the certificate.
Use the certificate name to find the certificate belonging to your team. For example, an Apple Distribution certificate begins with “Apple Distribution.”
In the certificate window, display the Trust section by clicking the corresponding disclosure triangle.
For the option “When using this certificate,” select Use System Defaults.
Close the certificate window.
Ensure that the certificate information shows the certificate is valid.
If your certificate is expired or is otherwise invalid, you receive the following error message:
Code Signing Identity 'iPhone Developer' doesn't match any valid, non-expired, certificate/private key pair in your keychain.In Accounts preferences, reset the signing certificate.
If you manually sign an app, download and import the provisioning profile that contains the new signing certificate.
If duplicate signing certificates are in your keychain—such as two development certificates or two distribution certificates (your keychain must contain at most one code signing certificate of each type)—, you receive one of these error messages:
Build error "iPhone Developer: <your_name> (XYZ123ABC): ambiguous (matches "iPhone Developer: <your_name> (XYZ123ABC)" in /Library/Keychains/System.keychain and "iPhone Developer: <your_name> (XYZ123ABC)" in /Users/../Library/Keychains/login.keychain)"[BEROR]CodeSign error: Certificate identity 'iPhone Distribution: <your_name>' appears more than once in the keychain. The codesign tool requires there only be one.If there is a conflict between the App ID in the provisioning profile and the bundle ID in your project, you receive error messages similar to the following:
Code Sign error: Provisioning profile 'MyApp Profile' specifies the Application Identifier 'com.mycompany.MyApp.*' which doesn't match the current setting 'com.mycompany.MyApp'In the project editor, choose the target and click General.
In the Identity section, set the bundle ID to match the App ID.
In the Signing section, verify that the team, provisioning profile, and signing certificate settings are correct.
Next to the provisioning profile, click the information icon.
In the dialog that appears, verify that the provisioning profile contains the correct App ID.
In addition, you can view the App ID and provisioning profile details in your developer account.