281

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

This issue is with Xcode-8 only with Xcode 7, same provisioning profile showing related identified certificate.

Mojtaba Hosseini
  • 95,414
  • 31
  • 268
  • 278
Satish Mavani
  • 4,897
  • 2
  • 20
  • 30
  • 3
    You need to a) update you provisioning profile with desired certificate or b) install the certificate (you may need to migrate it from other mac with private key as well, if it was not originally set up in your mac) – pedrouan Sep 19 '16 at 07:57
  • 4
    a) update you provisioning profile with desired certific. - I already did that but not worked b) install the certificate - certificat is already installed, and was created in same machine so i dont need to export any key or something. And as i said there is not any issue with xcode 7 in same machine. that means there is not any issue with installation – Satish Mavani Sep 19 '16 at 08:02
  • Check this, it quite fresh: http://stackoverflow.com/questions/39565906/code-signing-issue-in-xcode-version-8 – pedrouan Sep 19 '16 at 08:08

35 Answers35

335

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.

Eystein Bye
  • 5,016
  • 2
  • 20
  • 18
  • I still get `error: Provisioning profile "iOS Team Provisioning Profile: my.org.appName" doesn't include signing certificate "Apple Development: Dev Team Name (TEAMID123)". (in target 'My App Target' from project 'MyProject') ` . what to do? –  Feb 10 '22 at 03:21
  • Had to go to "Build Settings > Signing" and set every field to "Apple Development". – Tyler May 11 '22 at 20:04
202

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.

Nick
  • 9,792
  • 7
  • 50
  • 60
  • Thank you! Exactly what was happening here – Thomás Pereira Oct 22 '16 at 01:06
  • Keychain shouldn't let you add multiple copies of one file. Everytime I set up a project from scratch he got crazy with errors, just because some files are twice in keychain. FOR YEARS NOW -.-* – Silom Dec 12 '16 at 15:26
  • 9
    Did not fix the problem for me. This is likely one of those issues that can occur from multiple root causes. – Ash Mar 09 '17 at 09:44
  • After removing old keys from keychain access error still occurred. Xcode Preferences > Accounts > remove Apple ID and simply adding again solved the problem. – Yurii Koval Mar 21 '17 at 19:20
  • 3
    All my certs have private keys, so definitely the cause can be different. – RAM237 Apr 27 '17 at 17:01
  • 10
    In my case was several Certs (=signing identities) in **login** keychain with the same name, but of different dates (note in **System** keychain I got only one which was with correct date). Removing all except correct one did the trick. – RAM237 Apr 27 '17 at 17:19
  • The most interesting thing is that I haven't changed a single thing in Keychain Access or Xcode for about half of year, so this started to happen just "suddenly". Another interesting thing that my automated process used by Continuous Integration was able to build just fine, so the issue is just GUI related. – RAM237 Apr 27 '17 at 17:34
  • 5
    Similar to @RAM237, I've multiple certs with the same name that still have private keys attached. Removing all but the correct one helped. – junjie Jul 07 '17 at 07:14
  • Similar to junjie and Ram237 - I had multiple certs that only differed in expiration date; removing the one that wasn't used fixed the issue. – Vee Sep 04 '17 at 14:38
  • This! I was having the same issue, your answer made me double check. Thanks! – Nebojsa Nadj Apr 25 '20 at 19:31
92

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.

enter image description here

starball
  • 20,030
  • 7
  • 43
  • 238
Satish Mavani
  • 4,897
  • 2
  • 20
  • 30
  • Solve this issue but got this error, ":0: error: Swift does not support the SDK 'iPhoneSimulator9.3.sdk' Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1 " – Mohsin Qureshi Sep 22 '16 at 10:50
  • 1
    You should try by reboot your simulator and deleting derived data. – Satish Mavani Sep 22 '16 at 11:18
  • I tried, but not worked. its basically showing due to Alamofire. I think swift 3 is not compatible with Alamofire 3.0 – Mohsin Qureshi Sep 22 '16 at 11:33
  • I did tried same but giving me this error * has conflicting provisioning settings. * is automatically signed for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor. – user3625547 Sep 27 '16 at 14:09
  • You should delete profiles which are created manually, and then try with automatic sign. – Satish Mavani Sep 27 '16 at 14:13
  • 44
    Worst idea, you lose all your configs by letting xcode handle your cert. Lazy bastard Xcode will just generate new certs! – Silom Dec 12 '16 at 15:03
  • Same like I showed in the screenshot above. Are you facing any trouble, @JamesWierzba? – Satish Mavani Feb 05 '17 at 10:28
  • I'm trying to use Xcode to build an iOS application using Ionic 2. Where can I find these options in Xcode 8.2.1? – Xerri Feb 10 '17 at 07:31
  • But in my project Source code is on Jinkens server and I don't want to give my account credentials in it, So only need to manage manually. Is there any option for same? – sinh99 May 09 '17 at 10:02
  • This seems a silly way to handle certificates but it is the only solution working in my case. I am using XCode 9. – Yu-Chih Mar 02 '18 at 21:35
81

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 :)

d0ye
  • 1,580
  • 1
  • 15
  • 26
  • what type of certificates am I looking for? –  Feb 10 '22 at 03:28
  • this work for me...but why? I have 2 AppStore distribution profile from the same team, and the app has 2 configuration with 2 different bundle id and 2 different distribution profiles. – iGenio Mar 28 '23 at 21:33
39

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

Mussa Charles
  • 4,014
  • 2
  • 29
  • 24
31

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

Loke
  • 1,035
  • 1
  • 8
  • 16
27

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.

blackjack75
  • 502
  • 7
  • 12
  • 2
    For me, I didn't have duplicates, but after deleting and then re-downloading my provisioning profiles, it seemed to work properly. – Julian K Nov 30 '16 at 00:13
  • 2
    I tried everything else and nothing worked until deleting the existing profiles and letting Xcode re-download them – Ron Myschuk Dec 16 '16 at 20:13
  • 1
    Sorry, how can I access this ~/Library/MobileDevice/Provisioning Profiles ? I search on my finder and couldn't find any "Library" folder. – Chen Li Yong Mar 09 '17 at 01:54
  • 2
    @ChenLiYong That's a hidden folder. Press `CMD + Shift + .` to show all hidden files. – tmuecksch Nov 23 '17 at 09:20
  • @ChenLiYong Use "Go to Folder…" from the Go menu (in Finder) and paste in "~/Library/MobileDevice/Provisioning Profiles" – wuf810 May 15 '21 at 16:39
  • @wuf810 thank you. I have found it using the `CMD + Shift + .` trick. – Chen Li Yong May 17 '21 at 01:50
24

Had the same error. Profiles seems renewed, new certificates added, i even checked it when download. Also revoked former developer's certificates, excluded from provision profile. But Xcode still asking me about previous certificates with error:

No certificate for team 'MY_TEAM' matching 'iPhone Developer: FORMER_DEVELOPER' found

so, what I did to fix it:

  1. Go Build Settings -> Signing -> Code Signing Identity
  2. Find all 'FORMER_DEVELOPER' certificates and choose needed.

Hope it will help somebody.

Zaporozhchenko Oleksandr
  • 4,660
  • 3
  • 26
  • 48
24

If you use manual signing (which I would definitely encourage), this error may occur because Xcode thinks that it should sign a release build with a developer certificate, which is obviously not included in a release provisioning profile.

There is a build setting that defines which certificate should be used for which build configuration. To change it, go to build settings and search for Code Signing Identity. When expanded, there should be separate rows for each build configuration (usually Debug and Release) with in the second column its selected identity (usually iOS Developer or iOS Distribution). Make sure that it's set to the correct identity for each build configuration.

In some cases, the build configurations can also be expanded. Make sure that also its subitems are set to the correct identities.

Mark
  • 1,258
  • 13
  • 25
21

For those who still struggle with this problem in Xcode8. For me was a duplicate Certificate problem, this is how I solved it:

I read the answer of Nick and then I began my investigation. I checked all the keys and Certificates in my particular case (inside ~/Library/Keychains/System.keychain).

When I opened the file, I found that I had two iPhone Distribution Certificates (that was the certificate that Xcode was requesting me), one with the iOS Distribution private key that I have been using since the beginning, and another iPhone Distribution Certificate which its private Key had a name (iOS Distribution:NAME) that wasn´t familiar for me. I deleted this last certificate, started Xcode again and the problem was gone. xCode wasn´t able to resolve that conflict and that´s why it was giving signing certificate error all the time.

Check your keychains, maybe you have a duplicate certificate.

ThomasW
  • 16,981
  • 4
  • 79
  • 106
S.Go.Mot
  • 311
  • 1
  • 4
  • Exactly what happened to me. – funct7 May 23 '17 at 00:43
  • This is exactly the issue in my case, I had a confusion when setting up Fastlane Match and ended up having 3 duplicate keys in my Keychain – Minh Thai Sep 07 '19 at 03:56
  • that's right answer, actually when Its my first time and when I was creating the certificates I did not know which should I import it in Xcode and doing this I make duplicates and because of that I was getting error, I delete the duplicate and it worked – Bilal Yaqoob Dec 19 '22 at 14:27
13

You may also solve code signing issues with great Fastlane toolkit. Authors put a lot of effort to effectively automate building, signing iOS apps (and more).

So in the mentioned suite, there is tool sigh which magically resolves any signing issues, hence the name :) Nice thing here is, that this tool encapsulates a knowledge about common signing issues and can detect and resolve most of them.

Fastlane is installed as Ruby gem:

gem install fastlane

And then simply invoked:

fastlane sigh --development

Answer two questions, and voila:

[11:56:55]: No existing profiles found, that match the certificates you have installed locally! Creating a new provisioning profile for you
[11:57:01]: Creating new provisioning profile for 'com.myapp' with name 'com.myapp Development'
[11:57:06]: Downloading provisioning profile...
[11:57:09]: Successfully downloaded provisioning profile...
[11:57:09]: Installing provisioning profile...

Finally, go to Build Settings -> Signing, and switch to newly created provisioning profile, whose name you just saw in the command output.

This example is for development code signing problem (running on the device). Check sigh documentation for all other options.

Tomek Cejner
  • 1,152
  • 1
  • 11
  • 17
12

In my case, in keychain i had two certificates with same name, i removed one of the certificate which is duplicate then it solved the problem.

Arshad Shaik
  • 1,095
  • 12
  • 18
5

"Enable automatic signing" and then selecting a team from the drop-down menu helped me with this exact problem.

Warp
  • 363
  • 2
  • 9
5

I had remaining private keys from certificates I had revoked, certificates were gone but not the private keys. Deleting them solved the problem.

To find them:

  1. Open Keychain access
  2. Click "Keys" under category on the side left menu
  3. Look for iOS Developer: ..." keys that do not have a certificate tied to them
  4. I deleted them and problem went away

The highlighted key in the picture is a sample private key without a certificate.

The highlighted item was one key causing issues, deleting it solved issue

Dylan w
  • 2,565
  • 1
  • 18
  • 30
5

Because I haven't seen this specific answer:

My issue was I needed manual signing. So my mistake was that In Build Settings -> Code Signing -> Code Signing Identity

I had my debug (Automatic signing style, and Apple Development Certificate), Staging and Release (Manual and Apple Distribution (adHoc) variants set correctly.

What I DIDNT have set correctly (due to some flawed logic in my understanding) was the "ANY IOS SDK" value. Once I set it to the same manual Apple Distribution cert, the error went away.

Initially i had it set to an Automatic value "iOS Distribution" because I figured it would better handled automatically since I didnt know what it meant. still dont. oh well hope it helps

Jim
  • 1,988
  • 6
  • 34
  • 68
4
  1. Delete the developer certificate that does not have a private key.
  2. Delete the provisioning profile from your machine using go to folder (~/Library/MobileDevice/Provisioning Profiles)
  3. Then first check then uncheck the Automatically manage signing option in the project settings with selecting team.
  4. Sing in Apple developer account and edit the provisioning profile selecting all available developer certificates then download and add to XCODE.
  5. Select the provisioning profile and code signing identity in project build settings
PS_dev
  • 323
  • 3
  • 14
4

Xcode 11

This is the error I got

Provisioning profile "XXX" doesn't include signing certificate "Apple Development: XXX (XXX)".```

Now Xcode 11 automatically created a certificate "Apple Development: XXX" which is valid for all platforms

https://developer.apple.com/account/resources/certificates/list

You just need to

  1. Go to https://developer.apple.com
  2. Go to your provisioning profile
  3. Check if this certificate is selected
Ted
  • 22,696
  • 11
  • 95
  • 109
3

I have the same problem. I changed the mac. And when I downloaded the Xcode certificate, I received an error message: "The error is that the security profile does not include the certificate signature."

1) Go to https://developer.apple.com/account/ios/profile/limited/edit Select the project => edit => Certificates => Select All => Create => Download

2) In Xcode: Project file => Signing (Debug) => Provisioning profile => Import profile => Select file with 1

maxwell
  • 3,788
  • 6
  • 26
  • 40
3

The issue seems to start happening in Xcode 11.

  • Go to Apple Developer
  • Find the right provision profile
  • Press Edit in the right upper corner
  • Choose the (Distribution) option in Certificates. (I think it's a new option/certificate type that apple introduced though I couldn't find any documentation)
  • Optional: Delete all you provision profiles in (~/Library/MobileDevice/Provisioning Profiles/)
    go to Xcode ->Preferences->Accounts->Download Manual Profiles

enter image description here

Mike.R
  • 2,824
  • 2
  • 26
  • 34
2

For me, None of the above solutions worked. I was migrating from two older mac's to a new mac, trying to get release/debug profiles working on Xcode WITHOUT Xcode auto managing them.

The solution for me was that when I went and created the two new Certificates, i ALSO had to go into my provisioning profiles, and add (under both the distribution and dev) the new certificates to the provisioning profiles so recognized them. After doing this & downloading, xcode removed all errors and it is good to go.

Hope this helps someone!

Jprofficial
  • 329
  • 3
  • 10
2

I got one of these emails from Apple:

Dear John Doe,

The following certificate has either been revoked by a member of your development team or has expired:

Certificate: iOS Development

Team Name: Honey Team, LLC

This does not affect apps that you've submitted to the App Store or your ability to update your apps. If you're using provisioning profiles that contain this certificate, they must be recreated before they can be reused. For details, see the "App signing overview" section of Xcode Help.

Best regards,

Apple Developer Program Support


I created a new certificate which revoked the previous certificate (locally and on any other developer's mac). For it to work I must download the new provision profiles.

The solution is to:

  • login into Apple developer account
  • remove/revoke the previous certificates created in my name.
  • add the new certificate to the provision profile. You can identify the newer one by their expiry date
  • download them again from Xcode. Xcode >> Account >> Download All Profiles
  • restart Xcode

I personally didn't have such access. This access was only available to our team's admin, hence I don't have screenshots nor certain if these steps are 100% correct.

Community
  • 1
  • 1
mfaani
  • 33,269
  • 19
  • 164
  • 293
2

I haven't seen this mentioned yet but if you are still having issues after recreating your provisioning profiles, deleting the existing ones you have in your Provision Profiles folder, checking for dupes in your Keychain, etc (all other answers ITT), open your Target > Build Settings > Code Signing and make sure everything looks consistent in there. For example, I had changed the Code Signing Identify for Debug to a Distribution identity, which obviously wouldn't work as the Development Provisioning Profile doesn't have the Distribution certificate and was causing the error in the first place.

cumanzor
  • 174
  • 2
  • 9
  • Thanks! - In my case, under Target > Build Settings > Code Signing Identity > Release was set to iOS Developer instead of iOS Distribution. – Fiach Reid Aug 05 '18 at 20:59
2

If your trying to upload your app to iTunes Connect (your Provisioning Profiles are set to Distribution), Go to Project Settings -> Build Settings -> Code Signing. Make sure to set all of Debug and Release Options to your Distribution Provisioning Provisioning Profile.

Niall Kehoe
  • 416
  • 5
  • 17
2

This might help you

iOS Distribution profile

Scenario:

Another developer gave me a certificate.

I installed this simply

Error :

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

Which was not exactly correct error.

The error was the private key missing

Preference -> Accounts -> Double click team

enter image description here

Call the developer to send the private key.

and installed it into your locally

SECOND SOLUTION

  • Create a fresh certificate.

  • Edit your existing provisioning profile

  • Include fresh certificate

  • Save and download

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Shourob Datta
  • 1,886
  • 22
  • 30
1

It means you need to do either 1 of the below:

  1. You should have created a certificate at the Developer Center and then included that Certificate within the Provisioning Profile which you will Import into XCode.
  2. Else, If you are using a certificate created by someone else, then get them to share/export their certificate & private key (.p12 file) to you & you need to include this into your keychain. Refer here

A solution to #2 when you are not able to get the certificate & .p12 file from the creator would be to just check the 'Automatically manage signing' option.

javatogo
  • 308
  • 1
  • 11
1

Here are the steps solved for me (For those who face the same problem in XCode 9.2):

  1. Just manually deleted local profiles in ~/Library/MobileDevice/Provisioning Profiles.

  2. Deleted and created all the certificates and provisioning profile from developers account.

  3. Removed developers account from Xcode and re-added it.

Solved my problem! :-)

Shoaib Bagwan
  • 413
  • 5
  • 7
1

This happens because the provisioning profile can't find the file for the certificate it is linked to.

To fix:

  1. Check which certificate is linked to your provisioning profile by clicking edit on your provisioning profile in the Certificates, Identifiers & Profiles section of the Apple Developer dashboard
  2. Download the certificate from the dashboard
  3. Double click the file to install it in your keychain
  4. Drag the file into Xcode to be extra sure it is linked

The error should be gone now.

Jack Vial
  • 2,354
  • 1
  • 28
  • 30
0

Clicking but then cancelling "Enable Automatic Signing" worked for me, although the actual change it made was:

ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;

or in Xcode it's called Always Embed Swift Standard Libraries

tristanl
  • 21
  • 5
0

I had the same issue and reason was penny. Wrong profile and certificate was selected in build settings. I only had did this before few days. So, you do not need to enable "automatic" inside xcode. Check profiles inside your build settings before doing it.

Ruchi
  • 411
  • 4
  • 13
0

Try downloading the certificates/profiles directly from the member centre rather than doing it from Xcode.

It worked for me when I manually downloaded them from the member centre.

Somya
  • 65
  • 1
  • 7
0

I was struggling with it for many days.

Step 1: Deleted every certificates, provisioning profile, appID,Key etc from developer account.

Step 2: Recreated the push notification certificates, provisioning profile, app ID etc.

Step 3: Deleted all the certificates from keychain.

Step 4: Cleared all the provisioning profile from ~/Library/MobileDevice/Provisioning Profiles.

Step 5: Added only the required provisioning file and tested out. It works fine.

Alvin George
  • 14,148
  • 92
  • 64
0

This problem is due to private key in the certificate in your profile not match that in your keychain. I resolve this by

  1. delete all iPhone Developer certificate in keychain.
  2. delete all certificate in apple account.
  3. using xcode "Manage Certificates" to add certificate, sometime you still have certificate in your Mac, but I do not know where it is for now, and if added successfully, your apple account will display that certificate too, and then you can create your profile with that certificate and download ... goto 5
  4. if you use "Manage Certificates" can't add certificate, you can create a new certificate, and do remain steps.
  5. finish.

same answer with Code signing issue in Xcode version 8.

Yu Chai
  • 77
  • 4
0

First go to build settings and set your provisioning profile to automatic

Also go to code signing Identity and select "Apple development". Here is a picture on how should be shown

enter image description here

Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
christian
  • 1
  • 1
-1

I tried many things, but the only one that solved this problem for me was to configure some things in xcode:

Build Settings -> Signing:

  • Code Signing identity: Select iOS Developer for all options.
  • Code Signing Style: Automatic
  • Provisioning Profile: Automatic
-2

In my case the issue is that on Xcode Beta 11.5 there's a change on the ways to sign the app so just make sure that both for the Debug/Release the provisioning certificate is properly set