iosxcodeprovisioning-profileapple-developer

Xcode Provisioning Profile certificate error for iOS App Development


I am building an iOS app and I have done the following things in the web-based Apple Developer console:

I then open my app in Xcode and have tried importing that Provisioning Profile off the Signing & Capabilities tab, however I am getting an unexpected error:

enter image description here

Does anybody know why I am seeing this Provisioning profile warning/error, and what I can do to fix it so that I am able to build/codesign/archive it? I plan on manually uploading the archive to Test Flight so I can give my small list of beta testers an early-access preview for it.

Please note: I want to use manual codesigning, not automated.

Update

After following one of the recommended suggestions, when I open my downloaded Profile in Xcode I am presented with this error:

enter image description here

Interestingly enough, when I go to the Apple Developer console and look at all of my Certificates, none of them are named "Apple Distribution: Holdings LLC", so I'm not sure why Xcode thinks a certificate with that name should be embedded inside of the profile.


Solution

  • Step 1: First Create the CSR file

    1. Launch Keychain Access located in /Applications/Utilities.
    2. Choose Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority.
    3. In the Certificate Assistant dialog, enter an email address in the User Email Address field.
    4. In the Common Name field, enter a name for the key (for example, Abishek Thangaraj Dev Key).
    5. Leave the CA Email Address field empty.
    6. Choose "Saved to disk", then click Continue.

    enter image description here

    Step 2: Create enterprise distribution certificates

    1. In Certificates, Identifiers & Profiles, click Certificates in the sidebar.
    2. On the top left, click the add button (+).
    3. Under Software, select “In-House and Ad Hoc”, then click Continue.
    4. Follow the instructions to create a certificate signing request .
    5. Click Choose File.
    6. In the dialog that appears, select the certificate request file (a file with a .certSigningRequest file extension), then click Choose.
    7. Click Continue.
    8. Click Download. The certificate file (a file with a .cer file extension) appears in your Downloads folder.

    To install the certificate in your keychain, double-click the downloaded certificate file. The certificate appears in the My Certificates category in Keychain Access.

    Step 3: Register an App ID

    1. In Certificates, Identifiers & Profiles, click Identifiers in the sidebar, then click the add button (+) on the top left.

    2. Select App IDs from the list of options and click continue.

    3. From the options, confirm App ID type is automatically selected, then click Continue.

    4. Enter a name or description for the App ID in the Description field.

    5. To create an explicit App ID, select Explicit App ID and enter the app’s bundle ID in the Bundle ID field.

    6. The explicit App ID you enter here should match the bundle ID you entered in the target’s Summary pane in Xcode.

    7. To create a wildcard App ID, select Wildcard App ID and enter a bundle ID suffix in the Bundle ID field.

    8. Select the corresponding checkboxes to enable the app capabilities you want to use.

      The capabilities available to your type of app and program membership appear under Capabilities. A checkbox is disabled if the technology requires an explicit App ID and you’re creating a wildcard App ID, or the technology is enabled by default. Not all capabilities are eligible for all platforms.

    9. Click Continue, then review the registration information, then click Register.

    Step 4: Create an App Store provisioning profile

    To create a distribution profile for your app in Xcode, follow these steps:

    1. Navigate to "Certificates, Identifiers & Profiles" in your developer account.
    2. Click on "Profiles" in the sidebar.
    3. Click the add button (+) located at the top left corner.
    4. Under Distribution, choose the appropriate App Store distribution profile for your platform:
      • App Store: for iOS, watchOS apps, and App Clips.
      • tvOS App Store: for tvOS apps.
      • Mac App Store: for macOS apps, including those configured with Mac Catalyst.
    5. Select the App ID you used for development (matching your bundle ID) from the App ID pop-up menu.
    6. If you use automatic signing during development:
      • Choose "XC Wildcard" if it's the only option available.
      • Otherwise, select the Xcode-managed explicit App ID starting with "XC" and containing your bundle ID, or the registered App ID matching your bundle ID.
    7. Choose your distribution certificate and click Continue. Note that an App Store provisioning profile contains a single distribution certificate.
    8. Enter a profile name and click Generate.
    9. Finally, click Download to retrieve your distribution profile.

    This process ensures that your app is properly configured for distribution through the App Store or other relevant platforms. enter image description here Then right-click on the provisioning profile file and choose Open with > XCode. Profile will automatically be added and will be above screenshot.