# Provisioning profile mismatch

### iOS build failure: Certificate does not match provisioning profile

If your app build is failing or your download is not working and you see the error:

{% hint style="danger" %}
“It seems your app build has encountered an issue. The certificate used to generate the uploaded Provisioning Profile does not match the uploaded Certificate.”
{% endhint %}

This means the provisioning profile was not created using the same distribution certificate that you uploaded in your dashboard.

This mismatch causes the iOS build to fail.

#### Why this build failure happens

1. The provisioning profile was created using a different certificate
   * The uploaded .p12 file does not match the certificate used in the provisioning profile
   * An older certificate was selected during profile generation
2. Multiple apps exist in the Apple Developer account
   * The wrong certificate may have been used
   * The wrong App ID may have been selected

#### How to fix this iOS build failure

1. [Create a new distribution certificate](/app/download/ios/certifications/iphone-distribution-certificate.md)
   * Log in to your [Apple Developer account](https://developer.apple.com/)
   * Go to Certificates, Identifiers & Profiles
   * Click the + button
   * Under Software, select Apple Distribution or iOS Distribution
   * [Upload your CSR file](/app/download/ios/certifications/certificate-signing-request.md)
   * Download the generated .cer file
   * Open it in Keychain Access
   * Export it as a .p12 file

{% hint style="warning" %}
Export the .p12 certificate without setting a password.
{% endhint %}

2. [Create a new provisioning profile](/app/download/ios/certifications/iphone-provisioning-profile.md)
   * Go to Profiles
   * Click the + button
   * Select App Store Connect under Distribution
   * Select the correct App ID
   * Select the newly created distribution certificate
   * Generate and download the provisioning profile

{% hint style="warning" %}
The provisioning profile must be created using the same distribution certificate you upload in your dashboard.
{% endhint %}

3. Upload the new files
   * Go to your [Download dashboard](https://app.appmysite.com/app/download)
   * Navigate to the iOS configuration section
   * Upload the new .p12 certificate
   * Upload the new provisioning profile
4. Rebuild your app
   * Go to the [iOS Build Configuration](https://app.appmysite.com/app/download/ios-build-settings)
   * Click Build app button to trigger a new build

{% hint style="success" %}
Once both files match correctly, your build failure should be resolved and the download should complete successfully.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appmysite.com/app/download/build-failure/provisioning-profile-mismatch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
