Code Sign error: No unexpired provisioning profile

2019-02-01 17:22发布

I think I've reached the nadir of iOS provisioning hell. After migrating to a new mac and doing an archive for distribution, I received the error:

Code Sign error: No unexpired provisioning profiles found that contain any of the keychain's signing certificates

I then erased all certs and keys and provision profiles and did a "hard reset" (deleting all keys, certs, and profiles), following Apple's instructions by hand, with the same error. Then I did another hard reset and then had Xcode handle the whole thing via the Organizer, did another archive - only to see the same error.

I have all certs (WDRCA, Developer ID Cert Authority, iPhone Dev, iPhone Distribution) showing in Keychain Access, Xcode shows that it sees the dev and distribution certs, as well as the provisioning profiles, all marked with a green checkmark and "valid" status.

Code signing within the app show the correct dev and distribution is selected.

What's really troubling is that a Google search on the error shows one tech note from Apple that isn't very helpful, 2 tweets, and 3 results in Japanese - and nothing else. I contacted one of the tweeps and he said he fixed it with a hard result, which I have done twice.

Any ideas on where to go or what to do next?

22条回答
smile是对你的礼貌
2楼-- · 2019-02-01 17:39

What worked for me is to choose "Don't code sign" and then do a build. This generates an error, but seems to clear out whatever xcode is hanging on to. Then choose the right provisioning profile and build. This has solved similar problems for me in the past.

查看更多
Summer. ? 凉城
3楼-- · 2019-02-01 17:41

A few days ago I had exactly the same problem.

The issue is related to no having the correct distribution provisioning profiles; My error was that I added a new device to the portal and did not re-download the distribution profile from the developer site.

Today I had the same issue; while it was working perfectly with the developer profile i could not archive or build a distribution package..

I had to go to the portal and manually re-download my distribution profile because new hardware was added even though I am not actively using it on the developer profile (did not check the box to add it to the provision)

Hope it helps anyone

查看更多
男人必须洒脱
4楼-- · 2019-02-01 17:41

I had the same problem after upgrading the OS/xcode so its worth to try. the solution for me was simple, go to the ios provisioning portal. make sure the app certificate for the app is valid and not expired. download again it again and double click it to install. it should fix the problem.

查看更多
爷的心禁止访问
5楼-- · 2019-02-01 17:42

I faced the same problem after upgrading to Xcode 4.3.2 and SDK 5.1. Everything worked perfectly in the previously version of Xcode with SDK 5.0. After many hours of hair pulling I created a new distribution certificate in the iOS Provisioning Portal->Provisioning-> Distribution Tab and after downloading it and installing it into Xcode (drag-and-drop) it works to archive after selecting the new certificate in the Code Signing area for my target.

查看更多
不美不萌又怎样
6楼-- · 2019-02-01 17:46

After removing all devices/profiles/certificates and adding/creating it did still not work here too....also removing the Xcode prefs did not help.

but it seems to in the project settings, check in the build settings under CODE_SIGN_IDENTITIY, in my project the first line was set to a old profile but not visible in the list, only if you open the pulldown, after removing that it worked.

查看更多
The star\"
7楼-- · 2019-02-01 17:47

Reason Of Error

If you don't have any valid provisioning profile downloaded to your system's Library/MobileDevice/Provisioning Profiles folder then you might run into this error.

Solution

Login to your Apple Developer Account from Xcode->Preferences->Accounts and then download a valid provisioning profile.

Move to Target->General and select the correct Team.

Now go to Project Build Settings->Code Signing Identity and select just 'iOS Developer' and 'Automatic' in Provisioning Profiles. Your app will run smoothly.

查看更多
登录 后发表回答