Codesign error: Provisioning profile cannot be found after deleting expired profile - ios

Tried to rebuild an app that was working just yesterday. Got a message that a profile had expired, so I removed it from the iPod and from iTunes. When I chose a new profile (one with an * in the identifier), I now get an error:
Code Sign Error: Provisioning Profile (long string) can't be found.
What am I missing? I looked through related questions and didn't see this scenario already.

Sometimes your Xcode project file gets messed up, especially if you have an old project and first created it with an older version of Xcode/iPhone SDK.
What you need to do is open up the project file in a text editor, search for the 'long string' from your error and manually erase that line.
In fact, you should just go ahead and erase any line that points to any provisioning profiles. Then reopen the project in Xcode, go to the settings and reselect your new profile. This clears up issues like that most of the time.
The lines that point to the provisioning profiles will look like this:
PROVISIONING_PROFILE = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";

Here's a simpler solution that worked for me and which doesn't require the manual editing of the project file:
In Xcode, in the "Groups & Files" pane, expand "Targets" and double-click on your app's target. This brings up the Info pane for the target. In the "Build" section, check the "code signing" section for any old profiles and replace with the correct one.
Note that this is different from double-clicking on your project icon and changing the profile from there. Quite amazing :)
Ori

Project&Targets Properties -> "Don't Code Sign" -> OK -> cmd+S(or cmd+B);
Project&Targets Properties -> "Your Provision Profile"-> OK
Everything works again!

I agree with Brad's answer, that you can fix this problem by editing your target/project by hand, deleting any lines like this:
PROVISIONING_PROFILE = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";
However, in Xcode 4.2 and later, there is a much easier way to access this text and select and delete it. In the Project Navigator on the left, select your project (the topmost line of the Project Navigator). Now simply choose View > Version Editor > Show Version Editor. This displays your project as text, and you can search for PROVISIONING and delete the troublesome line, right there in the editor pane of Xcode.

Just saw a variation on this issue: I went into the project.pbxproj file as per Brad Smith's notes above, except in this case all of the PROVISIONING_PROFILE lines seemed to be correct, with no occurrence of the "bad" profile string that Xcode couldn't find.
However, the fix was the same: deleting ALL of the PROVISIONING_PROFILE lines in project.pbxproj, even though they looked "good" in theory, and then reopening the project in Xcode.

To achieve Brad's solution entirely in Terminal, use these commands
cd [Xcode project parent]
vi [Xcode project name].xcodeproj/project.pbxproj
/[offending provisioning profile] [Enter]
dd - delete the entire line
Press n until no more are found
Ctrl+x to save and close

In my case the problem was solved by opening Window -> Organizer, selecting my device and removing the old Provisioning Profile under the "Provisioning" panel on the right. The old one was already marked with a red "x" symbol but the iPhone was still using it.
Besides that profile, also the new one was showing up (with the same name) and after simply relaunching the application I had it running smoothly.

Just spent a hour or so doing this and with the help of Brad's advice and a few additional changes it all worked.
I've done this using the following: 10.7.3, Xcode 4.3.2, iOS 5.1 btw.
1) Right click on your myapp.xcodeproj and select package contents
2) open project.pbxproj with a text editor (don't recommend textedit as it may screw up the formatting)
3) Scroll all the way down until you find /* Begin XCBuildConfiguration section */
4) Notice that you have a debug and release sections
5) In the release section take a look at CODE_SIGN_IDENTITY & "CODE_SIGN_IDENTITY[sdk=iphoneos*]" it should look something like this:
CODE_SIGN_IDENTITY = "iPhone Distribution: MyCompany LLC";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: MyCompany LLC";
6) Take a look at PROVISIONING_PROFILE and "PROVISIONING_PROFILE[sdk=iphoneos*]" they should look like this:
PROVISIONING_PROFILE = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
This should match your provisioning profile in Xcode. To see if they match open Xcode > Window > Organizer > Devices > Provisioning Profiles > Right click on the profile > Reveal in Finder > The filename of the .mobileprovision is your profile id.
7) Scroll down in the project.pbxproj and find a second instance of the release section. The second instance of the release section should end with a comment saying /* End XCBuildConfiguration section */
8) make sure that the second section matches the first section so that CODE_SIGN_IDENTITY, "CODE_SIGN_IDENTITY[sdk=iphoneos*], and PROVISIONING_PROFILE are all filled in.

One suggestion I'll make since no one yet has said it: PLEASE PLEASE PLEASE make a backup of your whole .xcodeproj file BEFORE you start modifying it's contents. Screwing up the project file and having no backup will lead to a very very unpleasant experience.
Being able to back out of an edit can be a godsend.

Select the lines in codesigning that are blank under Any iOS SDK and select the right certificate.

The solution of Brad Smith worked for me, but I also had to remove the CODE_SIGN_IDENTITY field to make it work.

I just encountered this problem in my Xcode 4. To fix it,
you need to put all the correct provisions into both Debug and Release config.
I was trying to submit (by archiving) my app. So I just change the Debug provisions to "Don't Code Sign", and the Release provision to my app's appstore provision.
This fix it and enables me to archive normally. Hope that helps.

Unfortunately this approach didn't work out for me. But here's a fix which worked for me (to get this to work you need a working project file on Subversion or so):
I did roll back to an working version of my project file. As it isn't possible to revert with Xcode (Where is the 'Revert' option in Xcode 4's Source Control?) - I used Tortoise, my Windows machine and this Tutorial (http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-howto-rollback.html) to roll back to an older project file.
As the Tutorial didn't work out for me, I just used Tortoise to save the working revision of my project file to an usb stick to port it to my mac. After that I replaced the new broken project file with the old working one, cleaned and it worked like a charm!

At least in Xcode 5, this is the thing that solved the problem for me:
Under provisioning profile, select the offending provisioning profile and then select a valid provisioning profile in the pull-down menu.

You Could remove old reference of provisioning file. Then after import new provisioning Profile and selecting Xcode builder.

I was having issues because I updated my AdHoc provisioning profile with some new devices for use on TestFlight. Assumedly this is happening because Xcode has an old reference to your provisioning profile in either the codesigning build settings for the project or the targets. The way I fixed mine was to:
Go to both target build settings and project build settings, Under code signing change all the provisioning profiles to something else.
Go to devices/provisioning profiles in the Organizer delete the offending profiles, then click the refresh button in the bottom right.
Go back to to the target and project build settings and set your provisioning profiles to the appropriate (hopefully) newly refreshed provisioning profiles.

Related

Xcode Failed to load profile

My Xcode suddenly got a weird issue that there's some provisioning profiles I couldn't download or even import them manually. Got an error message all the time.
I tried to uninstall and reinstall Xcode again, and still got the problem. Also, I manually copied the profile into ~Library/Mobile Device/Provisioning Profiles folder, and my Xcode wouldn't recognize it.
Have anyone seen the issue before? Please don't ask me to delete and re-create the profile as it's a company provisioning profile, and it worked on my colleagues' computer.
Just recognize I was able to load or install all distribution profiles, all development profiles got the issue.
Here are a few checks I go through when I get anomalous behavior from Xcode with respect to development provisioning profiles.
Check to ensure that you have selected the correct Apple ID and correct Team by clicking Xcode > Preferences > Accounts > select the correct Apple ID on the left-hand side of the panel, and select the correct Team at the lower-right hand side of the panel
Check to ensure that you have installed the necessary components for Xcode by clicking Xcode > Preferences > Components > ensure the correct Toolchain is selected, then > Check and Install Now
Download the provisioning profile manually from the Apple Developer Portal, then drag-and-drop it onto your Xcode dock icon.
Open your project in Xcode and click on the project icon in Project navigator > Build Settings > scroll down to Code Signing Identity > ensure is set to iOS Developer
While still in Build Settings, scroll down to Provisioning Profile > ensure the name of the profile you expect is selected or that it is set to Automatic
Try to build.
If that doesn't work, you can try altering step 4. by doing the following instead:
Make sure to not select "Automatic" for the "Provisioning Profile" field(s) in Xcode > Build Settings
Instead, set all "Provisioning Profile" fields specifically to the profile with which you are trying to build
open the Terminal app
cd to the directory of your Xcode project
cd into your Xcode project, like so: cd MyProject.xcodeproj/
cd xcuserdata
open project.pbxproj -a TextEdit
hold the "command" key and tap "F" on your keyboard
enter 'PROVISIONING_PROFILE' and press 'return'
if 1 or more results are found, ensure the value to the right of the PROVISIONING_PROFILE variable is set to the UUID of the profile you want (i.e. compare to what you see in Quick Look to ensure a match)... if 0 options are found, something else may be wrong with your xcodeproj file
the UUID should be a string (surrounded by double-quotes), e.g. PROVISIONING_PROFILE = "abcdef01-2345-6789-abcd-ef0123456789";
save the file with TextEdit and then close TextEdit
try to build again
For those who also got this issue, I was able to resolve this bug by deleting complete my XCode 9.4.1 and all local provisioning profiles, and update to latest XCode 10.0. After that, I can install and load all profiles as usual.
Kindly make sure installed mobileprovision file is valid, otherwise kindly regenerate the mobileprovision from developer.apple.com site and import it manually in xcodeproject IDE.

Xcode has conflicting provisioning settings

I have an Ionic 2 app, which builds and is testable in Xcode 8.2.1 Simulator environment, e.g. iPhone7 (Build Successful).
When I try Archive the app to create an ipa file to set on a device, I follow these instructions. But Product -> Archive is greyed out. So I change the active scheme to Generic iOS Device.
But then when I click Product -> Archive, I get Build Failed.
theWhoZoo has conflicting provisioning settings. theWhoZoo 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. Code
signing is required for product type 'Application' in SDK 'iOS 10.2'
If anyone could advise how I can fix this to build an Archive, I would appreciate it.
This worked perfectly for me. Give a try :)
Step 1:
Select the Project Target-- > Build Settings. Search PROVISIONING_PROFILE and delete whatever nonsense is there.
Step 2:
Uncheck "Automatically manage signing", then check it again and reselect the Team. Xcode then fix whatever was causing the issue on its own.
The problem is in Code Signing Identity. This is a new problem that showed up on the latest release of Xcode. Go to Code Signing Identity, then add other and type in "iPhone Developer" as shown in the error message and save then this will display.
If this does not work show me your General signing. and your Code Signing Identity from both your Project and your Targets
The problem is in Code Signing Identity. This is a new problem that showed up on the latest release of Xcode. Go to Code Signing Identity, make all IOS Developer rather that IOS distribution.
UPDATE Just figured out the real issue [assuming that your app has the correct provisioning profiles, but a target for your app does not]: Navigate to your target and change the provisioning profile there. See below:
I got this error when I added a target to enable rich push notifications. The project/workspace, "Spontit" did not have this error but the target "RichNotification" did.
I tried several things, and the last thing I did, that seemed to be responsible for it finally working, was:
Un-add and re-add the embedded binary for the target "RichNotification" in the "General" tab of the project, "Spontit".
Another thing to check is to make sure that it is added as a "Target Dependency" in the "Build Phases" tab.
For this particular problem, make sure to clean your project (Cmd Shift K) before building it, every time. Otherwise, you might fix it and try to build it and think it's not working, but really it's using the old settings- so clean it first.
For me Only this worked.I tried changing the Provisioning Profile(Deprecated) Value to Automatic.
This worked for me and I hope it would be helpful
for someone.
Project Target -> Build Settings -> Code Signing Identity -> Change the Debug and Release to iOS Developer and iOS Distribution.
If you have error message like this:
[target name] is automatically signed, but provisioning profile xxxxx-xxxx-xxxx-xxx-xxx has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor, or switch to manual signing in the project editor.
You can fix like this:
1. Check Automatically code sign in
2. Uncheck Automatically code sign in, then check it again and reselect the Team. Xcode then fixed whatever was causing the issue on its own
3. If still not work, find project.pbxproj, search the profile, and just delete that line, then save it.
This work for me!
Close Xcode project.
Using finder go to project folder.
Right click on .xcodeproj and choose "Show Package Contents"
Right click on project.pbxproj go on "Open With" and choose TextEdit
Now search for your Provision Profile instanceId specified in the error message.
Delete all found texts and let Provisioning Profiles clean.
Save & Close.
Open Xcode
Enable automatically manage signing
Source: https://www.codegrepper.com/code-examples/whatever/has+conflicting+provisioning+settings+xcode
I tried multiple things mentioned in stack but nothing worked except above solution.
HERE IS THE FIX
FOLLOW THESE STEPS:
open your project in xcode, in my case I used xcode 9.
INSIDE THE GENERAL TAB DO THE FOLLOWING
UNCHECK THE FOLLOWING OPTION:
Automatically manage signing
THEN SIGN YOUR DEBUG PROFILE
provisioning profile should be your development profile from the dropdown
Team : will be populated because of the above provisioning profile
Sigining Certificate: will be populated.
THEN SIGN YOUR RELEASE PROFILE
provisioning profile should be your release profile from the dropdown
Team : will be populated because of the above provisioning profile
Sigining Certificate: will be populated.
That is all, clean and archive your project.

Code signing is required for product type 'Application' in SDK 'iOS 10.0' - StickerPackExtension requires a development team error

I am facing the below issue and am unable to build the application.
XXX has conflicting provisioning settings. XXX is automatically
provisioned, but provisioning profile WildCard has been manually
specified. Set the provisioning profile value to "Automatic" in the
build settings editor, or switch to manual provisioning in the target
editor. Code signing is required for product type 'Application' in SDK
'iOS 10.0'
I am also unable to choose a particular profile.
How to resolve this issue?
Holy molly, I had to do all this in order for it to work. A picture is worth a thousand words.
If you get this error while archiving then continue reading.
Go to your app and click on the general tab. Under the signing section, uncheck "Automatically manage signing". As soon as you do that you will get a status of red error as shown below.
Now here's the tricky part. You need to uncheck "Automatically manage Signing" in both the targets under your project. This step is very important.
Now go under "build settings" tab of each of those targets and set "iOS Developer" under code signing identity. Do the same steps for your "PROJECT".
Now do Xcode → Product → Clean. Close your project in Xcode and reopen it again.
After this go to the general tab of each of your targets and check "Automatically manage signing" and under team drop down select your developer account
Do an archive of your project again and everything should work.
Really, Apple? Was this supposed to make our lives easier?
Great, now we can choose the profile for Debug and Release separately in the general tab itself as illustrated in the image below.
Also when you click on Automatically manage signing it does all process that are created by Fix issue in previous Xcode versions.
Disabling automatic and then re-enabling has solved this for me in Xcode 8 GM seed. This can be done in the project settings, info tab for each target that needs to be signed.
I hate to say it. I just quit Xcode and opened it again. Simple and effective :)
For resovle this issue:
Go to Xcode/Preferences/Accounts
Click on your apple id account;
Click - "View Details" (is open a new window with "signing identities" and "provisioning profiles";
Delete all certificates from "Provisioning profiles", empty trash;
Delete your Apple-ID account;
Log in again with your apple id and build app!
Good luck!
This is what I would call a classically Apple Xcode UX design bug.
The error said there is a bunch of stuff YOU DID WRONG LOCALLY.
The error actually meant "we have a new agreement you did not accept online".
After checking and unchecking the Automatic Signing button I got this agreement error to display:
Signing into the developer portal I was able to see a banner for the agreement update notice:
.
Restarting Xcode 8 then cleared that error and only forced me to reselect the certificate I already had on my machine and tied to the project.
This could have been handled in a less confusing implementation, but this is how I fixed it. I am putting it here because it's way different than the steps everyone else gave.
Oh and yeah, having the pre-latest iOS 10 device and latest Xcode (I was on 7.3.1 or something) also threw errors until I updated.
This is how it worked for me:
Kill Xcode and launch again
Open project again
Clean Project
Go to project settings > general > uncheck 'automatically managed profiles' and than 'check' again it will prompt for enable.
Now try archiving the source code
P.S Killing Xcode and launch again is the best thing to do if facing any random issue
I fixed it doing this:
Set your team for all the targets of your project. Including the extensions. And left the automatic signing management.
Steps:
Under General → Signing
Uncheck: Automatically manage signing
Select Import Provisioning
The Untick-tick (check-uncheck) "Automatically manage signing".) of Xcode checkboxes don't work for me (as many suggested on the top).
It happens with frameworks linked in your project.
Solution:
Find your framework or any other target that required signing.
Go to Build settings
Search Signing Identity
Set Don't code sign manually.
I only needed to uncheck 'Automatically manage signing', check it again, and rebuild.
Click on Add Account if not signed in.
Then after select your team profile and check Automatically manage signing and leave everything else as is in Xcode. It will perform the remaining stuff by itself.
I ran into this type error by updating the Xcode version to 8.0,
and under the Code signing is required for product type 'Application' in SDK 'iOS 10.0'
There is a warning:
isn't code signed but requires entitlements. It is not possible to add entitlements to a binary without signing it.
My solution is go to the TARGET → General → Signing -> click the Enable signing... button, and I solved the issue.
If you are finding the following screen and facing the problem of code signing required, then one of the following solutions may help you.
Solution 1. As said before, sign in with an Apple ID. Then you will get options like this, if you enter correct bundle identifier. Then select the appropriate profile from the list.
Solution 2. If you don't want to sign in with your Apple ID, then change a small flag in project.pbxproj file. Find the following text in the project file.
/* Begin PBXProject section */
Change flag ProvisioningStyle = Automatic; to ProvisioningStyle = Manual; Refer to the following image. After changing the flag, you will see the options to select appropriate profile from the list.
in Build Setting change in Signing
Clean and Archive your code , Hope it will help you .
Xcode Version 11.0:
I recently upgraded to Xcode Version 11.0.
Looks like Apple moved the Signing to a new tab from the original General tab.
Navigate to the application
Select "Signing & Capabilities"
Click "Enable Development Signing"
Firstly in general tab -> signing section -> select a development team, manage signings
Similarly if you are working with multiple pod files select each pod target separately and go to general tab -> signing section -> select a development team, manage signings
repeat the same process for all pods in your project
Clean -> Build the project.
This worked for me
In unit test target
Xcode 7:
Must have provisioning profiles set (the same as in app target)
Must have "don't sign" under certificates
Xcode 8:
Must have 'None' set for provisioning profiles
Must have certificates set (the same as in app target)
(Must also have 'None' set for deprecated provisioning profiles)
All answers looks fine but i found still issue so i changed settings in Build like this in XCode 9.0 - Sharing it so it could help someone.
After applying all the solutions above, The same issue I was getting. i.e
So I solved this by removing the provision profile in build sending.
Please find the images which will make you more clear
Even when installing the Watch OS application extension, the same error occured in Xcode 8.1:
After updating the Provisioning Profile to Empty in Project of Build
Settings, everything work fine.
&& Code Signing Identity to iOS Developer in every targets Build Settings.
I upgraded to Xcode 8, and iOS 10, but I had the problem.
I fixed it by going to project general tab, signing section.
Click "Enable signing....."
That is it.
If you get this error while compiling in Microsoft Mobile Center
❌ Code signing is required for product type 'Application' in SDK
'iOS 10.3'
** ARCHIVE FAILED **
be aware that Mobile center doesn't yet support automatic signing with certificates of type app-store, ad-hoc and enterprise. Automatic signing only works with development certificates.
There are two things you can do to work around that limitation:
Use a development certificate. You'll have to create a new one in the developer.apple.com portal, download it to your machine, export it to a .p12 file using keychain, then finally provide it to Mobile Center. You know the drill.
Disable automatic signing. You will find that setting in Xcode in your project targets. Once disabled, a little "i" button will be displayed next to the "Xcode managed profile" label. Click that button, some info about the profile will be displayed. On the top left corner of that window, a "PROV" icon is displayed. That is the provisioning profile that you should provide to Mobile Center. Drag and drop the icon into the corresponding field in Mobile Center.
.
I did everything and didn't worked. I uninstalled Xcode 10 and installed Xcode 9.4 then it worked out of the box !
If you still have problem then please try this.
Build Settings -> User Defined -> Provisioning profile (Remove this.)
It will solved my issue.
Thanks
I have tried above all issue but was not working for me
What I tried is
First of all, I want to go with manual code signing process, I am not doing via automatic code signing
I specify team name
Then change deployment target
Clean and build
You will good to go now
1.1: If you are using p12 and a provision file, but not using AppID to log in, do not Select Automatically manage signing.
Which means you don't need to set your team. Just select your provision file and the machine code signing identity in Build Settings, like this Build Settings. Make sure the parameters are set as well.
And then go back to General. You will see General set, and that's OK.
If 1 does not work, try as other answers said, clean your project, delete the derived data folder, quit Xcode, and open again.
Just download your provisioning profile again from your developer account.
And sign out all developer accounts from Xcode → Preferences → Accounts → *Select Account showing at left and press -(subtract sign)
After deleting all accounts, press the + sign (add) button and sign in with all developer accounts.
It will work like a charm...
It is because you have not choosen a team when you created the project.
I am such fixed. And I choose it in build settings, but invalid. I must create a new project.
"I choose it in build settings, but invalid. I must create a new project." is wrong.
It is invalid because I have not chosen it in extension. You must choose a profile at your project's all extension, and there is no need to create a new.
[2
select your target and search for user-Defined section on build Settings,select provisioning profile and delete it

Missing entitlements file

I'm suddenly getting two warnings in XCODE:
/Users/me/Documents/Misc IOS DEV/myAPP/myAPP.xcodeproj Missing entitlements file for target myAPPUITests: "/var/folders/wb/9dsv1b5j53n8qbwmbh49qf9m0000gn/T/Entitlements.plist-gmk"
/Users/me/Documents/Misc IOS DEV/myAPP/myAPP.xcodeproj Missing entitlements file for target myAPPUITests: "/var/folders/wb/9dsv1b5j53n8qbwmbh49qf9m0000gn/T/Entitlements.plist-pCm"
Anyone have any idea what these are and how I can remove the warnings? Thanks!
Ok go to your target build settings and go to signing section
in code signing entitlements delete the path for entitlements
Restarting Xcode fixed the issue for me.
The folder those warnings reference is a per-user temporary file/folder cache. If restarting Xcode doesn't fix the issue, I'd suggest restarting OSX.
Product > Clean has worked for me multiple times.
By assigning your Apple Developer ID to the Code Signing Identity section of the Build settings, this should clear up the warning messages.
Go to Project> Target > Build Settings > Signing
Here in 'CODE_SIGN_ENTITLEMENTS', put your path.
$(SRCROOT)/ProjectName/PathToFolder/AnotherFolder/YourProject.entitlements
In case anyone finds this, the same happened to me with a new OSX project in the XCode 7.2.
In my case, I needed to add my device to my Developer account at https://developer.apple.com, and also create Provisioning Profile for the app.
I added my device by hand using the UUID from the 'Identifier' value in XCode's Devices Window.
I let XCode create the Provisioning Profile, by using the Organizer Window, selecting my App, and then clicking the 'Export ...' button and choosing 'Export a Development-signed Application'.
That cleared up the errors on the next build.
Depending on what you want, you can opt to not sign your software (for e.g. local builds, simply playing around).
Select your project in the tree view (item at the top), then in the main window, select "Build Settings", navigate to the section "Code Signing", which is where the error occurs ("code signing entitlements").
Then, for "Code Signing Entity", simply select "Don't Code Sign".
Just remember to update this when you do need to sign your app.
Click on your Project Targets, select Capabilities tab, and look for an issue on one of the enabled item. Click on the fix button. Another way to do this also by going to the Build Settings, search for Code Signing Entitlements, make sure it shows "yourProjectModule/EntitlementName.entitlements"
If you've enabled "Automatically manage signing" for your target(s), then go to your target settings, choose the "Signing & Capabilities" tab, and uncheck and then re-check "Automatically manage signing". It worked for me.

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

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?
Fixed it by Organizer -> Teams (select Your Team) -> Refresh (low right corner).
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.
I just had this problem as well. I finally realized that the identifier is case sensitive. For example if your product name is "StackOverflow" it automatically tags the identifier with com.yourcompanyname.StackOverflow. (this of course can be changed by going to the summary of the target). The problem lies in what the app id is in the developer portal. Make sure that the identifier in the portal matches what's in Xcode.
I have the same issue here since Xcode 4.3 install (moving from /Developer to /Applications). I found this post for changing the Xcode dir
in the terminal check what path it is set to with:
/usr/bin/xcode-select -print-path
and then if it is still set to /Developer set it to /Applications:
sudo /usr/bin/xcode-select -switch /Applications
which worked for me to be able to do the update to 4.3.2 but this did not resolve the issue mentioned....so maybe it helps you.
After nine hours of hair pulling, cursing and burying my head in my hands... All I had to do was create a new project, transfer the files over by hand, and the error went away. Argh.
Update: My marking my own answer as correct does not mean these other answers were wrong - I didn't get a chance to try any of them.
i 've met the same problem.
the answer of the problem is simple.
you need to login your apple develpoer web site
to apply and download a profile for your app .
after double-click the download file ,
you can see the file in organization of the project in xcode .
the name of the bundle id is the type like com.yourname.appname
the xcode device choose the ios device
and the codesign of the target should choose distribution
which is one of the file in organization of the project in xcode .
f.y.i.
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
I went straight to "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."
And that seems to have done the trick.
I fixed it by updating the bundle identifier in the project settings > targets > appName
in the info tab.
I had this problem, and fixed it by putting my scheme back to Debug, as opposed to Release.
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.
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.
I had this error when trying to build a release version - no problem occurred for debug builds. Baffling because in the code signing section of the build settings I had the same profile selected.
The solution for me was to create and download a new distribution provisioning profile, even though from the settings it appears not to be used.
I found a solution that was not on here, after looking through the errors and looking into my raw .app file, i found the solution.
Go to your target, and then "Build Phases" instead of Build Settings.
Make sure that in "Compile Sources" is your storyboard. For some reason Xcode didn't add the storyboard to this area of my file when I coppied the storyboard in.
P.S. I had to add the other .m's that i wanted in the project to this area as well (the ones that I dragged in, not created in the project)
Hope this helps
In the Target settings, in Sumary, check if Bundle Identifier is exactly the same as in itunesconnect.com
as example:
Bundle ID: com.mycompany.myapplication
I fixed mine by Analysing instead and checking that error. It indicated that my bundle ID was not lowercase as in the provisioning profile.
I actually was having this issue but whenever I tried to get into the organiser it caused XCode to crash. To resolve this issue I went into my targets and changed everything under Code Signing Identity to iPhone Developer. The target defaulted to the provisioning profile I wanted and it worked.
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.
Fixed it.
Went to Project-> general-> found an option "no provisioning profiles found" Fix Issue button. Clicked it . Automatically fixed
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.
In the Build Settings look for
General > Identity > Bundle Identifier and Team Settings. Fill in the Bundle Identifier and select Team. (this basically your publishing info). Of course as the others have written you'll need the correct dev or team account. This solution worked for me and resolved the build error.
Its because of the SUDO permission you have given while adding the platform.
Follow this link Ionic Code Sign error: No unexpired provisioning profiles

Resources