If a code signing error occurs

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 a provisioning profile can't be found

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 found

the provisioning profile is wrong.

If a certificate can't be trusted

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_TRUSTED

To fix this problem, set the trust settings for your development, distribution, and intermediate certificates to the system default.

  1. Launch Keychain Access.

  2. In the Category section, select My Certificates.

  3. 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.”

  4. In the certificate window, display the Trust section by clicking the corresponding disclosure triangle.

  5. For the option “When using this certificate,” select Use System Defaults.

  6. Close the certificate window.

  7. Ensure that the certificate information shows the certificate is valid.

If a signing certificate doesn't match any certificates

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.
  1. In Accounts preferences, reset the signing certificate.

  2. If you manually sign an app, download and import the provisioning profile that contains the new signing certificate.

If your keychain contains duplicate signing certificates

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 the provisioning profile App ID doesn't match the bundle ID

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'
  1. In the project editor, choose the target and click General.

  2. In the Identity section, set the bundle ID to match the App ID.

  3. In the Signing section, verify that the team, provisioning profile, and signing certificate settings are correct.

  4. Next to the provisioning profile, click the information icon.

  5. 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.

See alsoIf a signing certificate or private key is missingIf an intermediate certificate authority is missingIf a build has an entitlement error