72

After upgrading to macOS 10.13.4 and Xcode 9.3, my project now makes all my Provisioning Profile ineligible! They worked before upgrade.

The error message for the distribution profile is:

Provisioning profile "distribution profile name" doesn't include signing certificate "development certificate name"

So I search through the forum:

  • remove ALL items in keychain My Certificate
  • redownload the distribution profile (double tap to install to Xcode)
  • create new distribution profile (double tap to install to Xcode)
  • recreate the Production certificate (double tap to install to Keychain)
  • redownload the Development certificate (double tap to install to Keychain)

So now my keychain has two production certificate (one is newly created), and one development certificate, and the error is still there. I found it weird that it asked for the development certificate in distribution profile? (I think this is a clue but I don't know why and what to do.)

So now what should I do?

Drew Reese
  • 165,259
  • 14
  • 153
  • 181
Lim Thye Chean
  • 8,704
  • 9
  • 49
  • 88
  • Do you have the private key for your certificates? When you view your certificates in the keychain, do you have the ability to expand them to see a private key underneath (should be a little triangle that lets you see the private key. If not, you will need to fully recreate your certificates from a new private key. – wottle Apr 04 '18 at 11:55

15 Answers15

92

I got two options for you:

  1. Open KeyChain and find the signing certificate that shown in the error message then delete it.

  2. You specified the signing certificate in the Build Setting -> Signing, so go to the Build Setting -> Signing and click the Code Signing Identity. Do not select Automatic (iOS Developer or iOS Distribution), select the one of the signing certificates in the Identities in Keychain which is valid and have associated with the Provisioning Profile.

Drew Reese
  • 165,259
  • 14
  • 153
  • 181
David Ding
  • 1,021
  • 7
  • 4
  • 22
    Deleting the extra certificate worked! Kudos to you for saving me from exceeding the go-live date on my app! – Parth Sep 26 '19 at 09:59
  • Kudos !!!!! this totally worked, I think the long-term solution is to have a much better-defined fast file , but he gives me more time to get to it. Thank you so much !! [[ What I mean by a long-term solution: https://dev.to/matt_catalfamo/how-to-build-and-manually-sign-an-ios-app-with-fastlane-2256]] – Chandan Maruthi May 22 '21 at 17:49
  • tried both, not working – Ben Nov 20 '21 at 21:54
22

For XCode 11 and later make sure to update the profile certificate updated with "For use in Xcode 11 or later" which resolves the issue for me.

enter image description here

Dinesh Nagarajan
  • 1,063
  • 2
  • 10
  • 22
  • 2
    where can i found this setting ? – calvin sugianto Oct 11 '20 at 06:45
  • 1
    In developer account with the certificate mapped with the project. – Dinesh Nagarajan Oct 11 '20 at 06:47
  • 29
    This! On developer.apple.com go to Profiles, select your Profile and Edit. Your certificate appears twice, one has "Xcode 11 and later" behind. I selected both but that one is probably enough. Re-download and import again. There is a large extra space reserved in hell for Apple's development eco-system – dube Jan 20 '21 at 07:46
  • 1
    This was the only thing that fixed the issue for me. I had exported my developer account from the old mac laptop - but that didn't do it. I had to regenerate my profile with all Developer Certificates selected. – N.W Jul 05 '21 at 01:27
  • @dube Thank you so much! Now i can finally stop using the automatic signing – Andrey Mikus May 16 '22 at 10:13
18

I temporary solved the issue by going into Build Settings, and manually set Code Signing Identity (the old way). "Automatically manage signing" no longer work properly, but at least it work.

Lim Thye Chean
  • 8,704
  • 9
  • 49
  • 88
12

"Automatically manage signing" is not working on Xcode 9.3. Code signing identify should be selected manually in Build Settings.

It is right. You can select Code Signing Identity as iOS developer for development and iOS distribution for production in Signing of build settings.

Andreas Braun
  • 161
  • 1
  • 4
  • I did not even know it was possible for the signing settings to skew in this way, but mine were and your answer pointed me to it. Thanks! – Mike Hardy Apr 27 '19 at 04:41
  • The key for me was to go into the Build settings, where I could change what certificate to use manually. (Xcode 13.2) – davidanton1d Feb 02 '22 at 05:30
  • Yes, it's working. Just change supperate certificate for Debug and Release from `Code Signing Identity -> Build Settings`. – Naresh Oct 21 '22 at 14:46
7

check out screenshot it says it all...

Targets>>Build settings>>(search)Product bundle identifier>>this was wrong for me :(

Targets>>Build settings>>(search)Product bundle identifier>>

Abhishek
  • 454
  • 3
  • 9
7

You need to make sure that:

  1. Your Apple Development -> Certificates, Identities & Profiles all have the correct provisioning profile "distribution profile name" that include signing certificate as in fig 1. below
  2. Same inside xCode

fig 1. enter image description here

Taras Gleb
  • 158
  • 2
  • 5
5

In my case, the Provisioning Profile on developer.apple.com listed two developer certificates. One was selected, and one was not. Changed it so both were selected, saved that, installed the updated profile and that fixed it.

stevex
  • 5,589
  • 37
  • 52
  • This one helped in my case when I was using fastlane match and it created two certificates instead of single one. – atereshkov Feb 01 '20 at 08:39
5

For anyone running in this issue in 2022 an later..

Sometimes it doesn't include Profiles, so go to below screen and click Edit.

enter image description here

Select the profiles you want to include.

enter image description here

After that, you can go back to xcode and download the profile again.

enter image description here

Cyber
  • 2,194
  • 4
  • 22
  • 41
  • 1
    Thank for providing a solution for me dealing with macOS Catalysts @Cyber – husharoonie Dec 17 '22 at 11:08
  • I had to repeat everything several times. Seems like having old keys of expired certificates in keychain that happen to have the same name as the new key may be a problem. After erasing almost everything from the Keychain Access and adding fresh items again made Xcode to work. So frustrating – IgorD Jul 12 '23 at 14:57
4

"Automatically manage signing" is not working on Xcode 9.3. Code signing identify should be selected manually in Build Settings.

Andreas Braun
  • 161
  • 1
  • 4
4

I had to juggle a bit more too. I deleted my keychain, enabled and disabled autosigning before recreating my certificates.

Then I toggled the certificates in Build Settings section and finally I was able to select the correct certificates in general section.

Really missing the simplicity of signing for Android.. :P

Ruuhkis
  • 1,924
  • 1
  • 27
  • 46
4

For me, adding the certificate to the Keychain which is linked to the provisioning profile did not help, which was very strange.

What I did to solve the issue is close XCode and re-open it, which seems stupid but worked! Apparently, it seems XCode does not dynamically read newly added certificates in the Keychain, so you have to close it (if it is kept open while adding the certificate to Keychain) and open it again.

My XCode version: 14.1

FutureJJ
  • 2,368
  • 1
  • 19
  • 30
2

In my case, I changed the Provisioning Profile to solve the problem by changing the Certificate whose type is "iOS Distribution" to another Certificate whose type is "(Distribution) For use in Xcode 11 or later", then download it and import it to keyChain, select it form Xcode.

Kexi He
  • 71
  • 1
  • 6
  • Yeah, was able to fix it, by clicking on the provisioning profile, editing it, and adding iOS Distribution to the list of certificates. – trees_are_great Jan 17 '22 at 15:35
1

In my case I had multiple profiles and various certs. I had to go to Apple developer and edit the profile from the error, and add every cert to it, and then it worked.

Sara Inés Calderón
  • 1,070
  • 12
  • 22
0

in my case, previous certificate got expired , while creating the new provisional certificate i missed to select ios distribution (in house).

Ragu
  • 51
  • 4
-1

If you have this certificate on another machine, you can export it from keychain and import on the other.

My problem was that I didn't know how to match private keys with certificates because I used "all items" filter in KeyChain.

If you switch to Certificates private keys are arranged under certificates, so you can easily export the right pair.

DanSkeel
  • 3,853
  • 35
  • 54
  • This didn't work for me. Even though I had exported all my certificates from the Keychain on my old device, and they showed as correct in the Keychain on the new machine. Xcode wasn't recognizing everything it should be. The answer provided by Dinesh (to regenerate Profile from developer.apple.com) worked. – N.W Jul 05 '21 at 01:32