96

I am trying to sign an app with my client's certificates. I have received the following file from the client

enter image description here

I tried installing the ios_distribution certificate and the key (.p12). Also I have installed the provisioning profile. Now when I try to sign the app with the provisioning profile, it does show up in the drop down but I get the following error:-

No "iOS Distribution" signing certificate matching team ID "7S977Lxxx" with a private key was found

enter image description here

How can I solve this issue? Any help is appreciated.

wottle
  • 13,095
  • 4
  • 27
  • 68
user3034944
  • 1,541
  • 2
  • 17
  • 35
  • Check your App's bundle identifier. Is it match with Apple develper account's AppID Identifier? – Brijesh Shiroya Jul 12 '17 at 07:20
  • @BrijeshShiroya yes. It was different at first and it showed me the error. I changed it later to the one mentioned in the certificate – user3034944 Jul 12 '17 at 07:25
  • For me it was all about selecting the checkbox: _Automatically manage signing_ – mfaani Apr 02 '18 at 19:00
  • Can you show a screenshot of the certificate in your Keychain Access app? Ideally you should show it expanded. If correctly installed, you should see the private key associated with the cert. – wottle Apr 18 '18 at 18:34
  • 2
    I selected and deselected Automatically Manage Signing and it worked. – John Franke Jun 25 '18 at 15:22
  • @JohnOttenlips Where is this automatically manage signing option? – June Wang Mar 09 '19 at 07:49
  • @JuneWang, it is on your target, under the general tab => signing. There is a checkbox for automatically manage signing – John Franke Mar 12 '19 at 19:13
  • I've .p12 file and profile both. I don't have apple account credentials. getting the same error. I do not have developer access too. Is it mandatory? – Ramcharan Reddy Apr 21 '20 at 08:42

13 Answers13

73

I had the same issue and I have gone through all these solutions given, but none of them worked for me. But then I realised my stupid mistake. I forgot to change Code signing identity to iOS Distribution from iOS Developer, under build settings tab. Please make sure you have selected 'iOS Distribution' there.

Naval Hasan
  • 1,226
  • 1
  • 13
  • 18
  • 4
    This is the answer if you're dealing with legacy apps. Also choose "apple" instead of "ios" because that's the new cross-platform style. – CGuess Apr 03 '20 at 02:26
  • 1
    @CGuess 's suggestion helped with conjunction to to Hasan's answer. Setting the identity to "Apple Distribution" from "iOS Distribution" worked – Mohammed Atif Sep 17 '20 at 14:22
  • 2
    I think Xcode at some point changes this for you, maybe a bug, because I would NEVER change this yet ran into the same issue. I feel like creating a million sock puppet accounts just to upvote this. – Kendall Helmstetter Gelner Mar 21 '22 at 21:57
36

You need to have the private key of the signing certificate in the keychain along with the public key. Have you created the certificate using the same Mac (keychain) ?

Solution #1:

  • Revoke the signing certificate (reset) from apple developer portal
  • Create the signing certificate again on the same mac (keychain). Then you will have the private key for the signing certificate!

Solution #2:

  • Export the signing identities from the origin xCode
  • Import the signing on your xCode

Apple documentation: https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html

Community
  • 1
  • 1
Kassem Itani
  • 1,057
  • 10
  • 15
  • @green you can revoke the signing certificates on the apple developer portal However I am not sure I understood what should I export and where – jaycee Oct 17 '18 at 15:59
  • 2
    I had to restart XCode to fix associating my Provisioning Profile with my Signing Certificate – Jaggler3 Feb 04 '21 at 17:22
26

enter image description here

Solution Steps:

  1. Unchecked "Automatically manage signing".

  2. Select "Provisioning profile" in "Signing (Release)" section.

  3. No signing certificate error will be show.

  4. Then below the error has a "Manage Certificates" button. click the button.

enter image description here

  1. This window will come. Click the + sign and click "iOS Distribution". xcode will create the private key for your distribution certificate and error will be gone.
  • Why is unchecking the Automatically manage signing necessary? Won't Xcode manage it for you automatically? – Boon Jun 23 '20 at 06:49
18

Tried the above solutions with no luck ... restarting my mac solved the issue...

Hend El-Sahli
  • 6,268
  • 2
  • 25
  • 42
2

I literally just went to "Signing & Capabilities" for my build target and took no further action and the next build worked.

Merely visiting that screen seemed to update the Signing Certificate

Tyler A.
  • 3,048
  • 1
  • 23
  • 27
1

Goto Xcode -> Prefrences and import the profile enter image description here

Ragul
  • 3,176
  • 3
  • 16
  • 32
  • 3
    Thanks for the answer. But when I try the Import Developer Accounts options, it shows the certificates in my folder, but they are all grayed out – user3034944 Jul 12 '17 at 07:27
  • 1
    This helped me. In my case, I just had to log in again on the Xcode > Preferences > Accounts tab and then click the button to refresh my cert. – MrColes Jan 23 '19 at 17:34
  • @MrColes where is the button for refresh? – Nathan B Apr 28 '23 at 16:28
1

I got the "No signing certificate" error when running Xcode 11.3 on macOS 10.14.x Mojave. (but after Xcode 12 was released.)

I was also using Fastlane. My fix was to set generate_apple_certs to false when running Match. This seemed to generate signing certificates that were backwards-compatible with Xcode 11.3

Match documentation - https://docs.fastlane.tools/actions/match/

This is the relevant section of my Fastfile:

platform :ios do
  lane :certs do
    force = false
    match(type: "development", generate_apple_certs: false, force: force, app_identifier: "your.app.identifier.dev")
    match(type: "adhoc",       generate_apple_certs: false, force: force, app_identifier: "your.app.identifier.beta")
    match(type: "appstore",    generate_apple_certs: false, force: force, app_identifier: "your.app.identifier")
  end

  ...
Phill Z
  • 141
  • 5
  • I'm 11.3 and still having the issue I had one app that worked a couple of days but now another app doesn't work I tried everything suggested here and so far nothing...I even deleted all certificates from keychain and redid still no cigar... I always have this issue when changing to a different machine – becker Mar 23 '21 at 16:38
1

Apple updated their agreement, so I had to

  • go to apple connect
  • accept the agreement
  • toggle automatic manage signing off and on
Eng.Ahmad
  • 31
  • 2
0

Double click and install the production certificate in your key chain. This might resolve the issue.

Rishav Kumar
  • 4,979
  • 1
  • 17
  • 32
0

I am working for an enterprise company so we archive the app on more than mac. The issue is related to computers count. You should archive the app a mac which was created certified on keychain.

Identifier and Profiles are the same but don't forget that you create a certificate for each mac machine.

So, We need to have as many certificates as there are computers. The below link is useful for creating a certificate.

https://blog.codemagic.io/how-to-code-sign-publish-ios-apps/

Metin Atalay
  • 1,375
  • 18
  • 28
0

If you are sure to have the cert. included in your provisioning profile but still getting this issue then give below steps one try.

  • Turn off you mac's internet access.

  • Tick Automatic manage signing.

  • Untick automatic manage signing.

  • Turn on you mac's internet access.

Error should go away.

Explaination for steps:

Sometimes xcode couldn't sync settings automatically. Above steps update it manually.

user3305074
  • 744
  • 7
  • 19
0

The problem for us was the expiry of our Apple Developer Program membership

-4

Our solution was to run

fastlane match

as I forgot we setup a Matchfile.

Greg Hilston
  • 2,397
  • 2
  • 24
  • 35
  • @babibo Not exactly. `fastlane` and `match` are open source projects. Its a defined command and not custom. It could help someone who uses `fastlane` and `match` and did not understand that they needed to run that command... No need for the negative-ness mate – Greg Hilston May 09 '19 at 21:11