Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 8 shows error that provisioning profile doesn't include signing certificate

People also ask

How do I add a certificate to my provisioning profile?

In the Provisioning Profile section, click the + button to add a new one. Select the type of profile, such asApp Store or Ad Hoc, and click Continue. Select your App ID from the drop down list and click Continue. Select the certificate you created in step 1.

How do I enable signing in Xcode?

Open the project using Xcode. Select the root project directory, and go to the Signing and Capabilities tab. Here, you can either check Automatically manage signing or do the signing manually. If you check the Automatically manage signing checkbox, then you will just need to select the Team from the drop-down list.


There are many ways to fix this, like enabling automatic signing etc. But if you want to understand the reason for this error you need to look at the error message.

It says that the provisioning profile you have selected in the "General tab", does not contain the signing certificate you selected in the "Build settings" -> "Code Signing Identity".

Usually this happens if a distribution certificate has been selected for the debug identity under "Build settings" -> "Code Signing Identity".

If this happens under "Signing (Debug)" it might also be that the "Signing Identity" -> "iOS Development" is not included in the provisioning profile.


Check your keychain for identities that are missing a private key. I had multiple distribution certificates installed for the same team, one of which was missing the private key. Xcode was only checking the first matching identity in the keychain and automatically using this as opposed to the one that did include the private key.

enter image description here

Removing the matching identity that didn't have a private key made Xcode detect the correct identity again.


To fix this,

I just enable the "Automatic manage signing" at project settings general tab, Before enabling that i was afraid that it may have some side effects but once i enable that works for me.

Hope this helps for others! enter image description here


For those who should keep using not auotamatic for some reason

Open keyChain Access to see whether there are two same Certifications ,If there's two or more,Just Delete to one and it will work :)


I experienced this issue after recently updating Xcode to version 9.3 The issue was in code signing (under debug) certificate was set to distribution certificate instead of development certificate so this prevented me from installing the app on my devices.

Here is what I did to solve this issue.

Project -> Targets -> Select your app -> Build Settings -> Code Signing Identity -> Debug -> Double tap "iPhone Distribution" and change it to "iPhone Developer".


I unchecked and then checked the "Automatically manage signing" option. That fixed it for me.


For what it's worth automatic signing failed every time until I just manually deleted local profiles in: ~/Library/MobileDevice/Provisioning Profiles

After that automatic signing worked perfectly and it got the right profiles from Apple's servers.

This was affecting only some builds, notably the ones for which I had manually created profiles for watch app.