IOS: Code signing error Xcode 6.3.1 [duplicate] - ios

I've build a new application which is going to support IOS 7. I got the new XCode 5 GM and tried to sign my apps using my fresh provisioning profile and distribution certificate, but i'm having trouble with distribution. I constantly get the following error:
"Invalid Code Signing Entitlements. The entitlements in your app
bundle signature do not match the ones that are contained in the
provisioning profile. According to the provisioning profile, the
bundle contains a key value that is not allowed:
'[XXXX.com.sample.company ]' for the key 'keychain-access-groups".
Also the same error for a key value called application-identifier.
Screenshot of the errror:

The solution lies in the new option in Xcode 5 which says provisioning profile. Just set the project target's provisioning profile to the right one and it'll work.

If you are like me and you think you tried EVERYTHING, archived your project over ten times, banged your head on the keyboard and still get this error. Please do yourself a favor and simply Restart XCode, it worked for me. Sometime Apple... I hate you.

I went through many of the steps above but what finally worked for me was refreshing my profiles in Xcode. Not sure why it was necessary since my app's distribution profile was showing up in the list already. Here are the steps:
Xcode Preferences
Accounts tab
Select your Apple ID
Hit the View Details button in the Apple ID detail panel
Hit the Refresh button in the lower left corner

In my case, i activated the same capabilities in Xcode that in Application services in developer.apple.com. Thats works for me

In my case (sorry) I switched "Team" to "None" in -> General -> Identity
In another case I needed to switch this identity from "None" to the developer account managing the identities and profiles.
Xcode sometimes messes up greatly with code signing, it seems. Or, we mere mortals simply aren't clever enough to understand what it is doing, of course. Don't give up, we're all going through some code signing torture at times!

In my case, I had to set correct Provision Profile for Release, and then had to restart Xcode. Before restarting, it had same provision profile, and didn't work. So, sometimes a restart can do miracles. Maybe this helps somebody.

If someone uses a GameCenter then check this section in your target. I worked with some old project and there were 2 errors (but everything worked fine). Disabling and enabling it back solved this problem.
Most likely this action adds Game Center entitlement to App ID and and handle it itself.

1.Go to project folder, delete *.entitlements files.
2.Then go yo in xcode project target -> build settings -> code signing entitlements - delete values
3.Clean
4.Run

Ah, this glorious error. For me whenever I see this error I check the following things:
1. Allow XCode to access your provisioning profile info all the time - If XCode keeps asking when you start it up to have access to your computer's private files so that it can get provisioning profile information with the options to allow access always, not now, or just one time - set it to ALWAYS ALLOW access
2. If you have any old entitlement files kicking around your project get rid of them and any sign of them - if you see a .entitlements file in your project delete it (or at least remove the reference to it if you aren't sure you are ready to outright delete it), then make sure the 'Code Signing Entitlements' line under the 'Code Signing' section in Build Settings is empty
3. Check your Application Services online and match them up with your Services in XCode for the app - Go to the Apple Member Center and check the App ID for your app, click on the app to see its 'Application Services' and see what you have checked, then go to XCode and check your 'Capabilities' section to make sure the two have the same list of Apple services on both
4. Make sure you assign a valid Provisioning Profile to your app before validating - double check your provisioning profile for your app in the Apple Member Center, make sure it isn't expired, has the right App ID with the correct bundle id and distribution. Download and click on the new provisioning profile to make sure XCode has it, or go to XCode > Preferences > Accounts > click on your account and 'View Details' then click the bottom corner button to Sync all the profiles to XCode. You should have the profile available to select now in the 'Code Signing' section. Once you have the correct provisioning profile then you can set the 'Code Signing Identity' lines to the correct option for that provisioning profile.
Note - if doing a distribution certificate it can help to set all the 'Code Signing Identity' lines to the identity you use for distribution including the debug lines
5. IF ALL ELSE FAILS - Clean your project and Restart XCode and some Apple magic may just work fine the next time you open your project and try to Validate

If you're building an old 3.1.5 project, Xcode 5 has some bugs which unfortunately makes Benjamin's answer impossible, as there are no Provisioning profiles to pick from. After many a late hour of tormented reading of Xcode project files I came up with this solution that worked for me:
In the Utilities pane (to the right) in Xcode 5, under project Document, change from Xcode 3.1-compatible to Xcode 3.2 compatible.
Enter your organization name.
Close project.
Open your project file, e.g. open -a TextEdit path/to/name.xcodeproj/project.pbxproj
Remove the two Distribution clauses (isa=XCBuildConfiguration).
Remove the two accompanying lines in buildConfiguration (one in PBXNativeTarget and one in PBXProject XCConfigurationLists)
Now you're ready to re-open, archive and submit to App store - voilà! It works again!
How I think it works
I assume this works because Apple somewhere along the line decided to drop the need for any separate distribution config, which is a good thing. When I archive, Xcode automatically code signs for distribution. That's the way it should have been implemented in the first place, it's just a shame that Apple can't make auto-migration part of the IDE; instead they force us developers to spend man-decades to make this stuff work.

I have been struggling with this problem for more than a day now, trying all kinds of solutions suggested here and elsewhere on the internet. Nothing worked...
But, I finally managed to solve the problem!
The problem I had was with an old app that I haven't touched in over 3 years, and now I was about to release a long awaited update. Since the time I released the app, Apple has been updating how the certificates and App Id works. They have introduced the concept of Team Id which seems to be recommended to use.
In particular, the Apple's "Certificates, Identifiers & Profiles" site, has seen a lot of changes since then.
There I realized that the Provisioning Profile I was using for App Store Distribution were connected to the App Id ED8xxxxxxx.com.rostsolutions.* but looking at the App Id for the game I was about to submit I notice that the App Id was ATMxxxxxxx.com.rostsolutions.Swisch. So the App Id prefix did not match!
That seemed to be the root of the problem. So what I did was to create a new Provisioning Profile connected to the App Id ATMxxxxxxx.com.rostsolutions.Swisch instead. Using that Provisioning Profile I successfully submitted my app to App Store and now I just keep my fingers crossed that everything else works fine at Apple's side.
(I first tried to connect to new Provisioning profile to the wildcard Id ATMxxxxxxx.com.rostsolutions.* instead, but that didn't seem to work).
But what puzzles me is that when I look at the old App in iTunes Connects and goes to Binary Details, it says that the App Id is ED8xxxxxxx.com.rostsolutions.Swisch. So why is the "Certificates, Identifiers & Profiles" page listing the App Id as ATMxxxxxxx.com.rostsolutions.Swisch?

My problem was solved by removing my Apple ID from Preferences->Accounts and then adding it back again. Then all my provisioning profile files showed up on the View Details utility panel. I was mistakenly choosing "Mac Team Provisioning Profile:*" instead of the actual distribution provisioning profile for the project thinking that it was a generic selection. Provisioning files must be specific to the project. Oh, and BTW, make sure your provisioning profile has the correct entitlements (for example, Maps). I managed to release an app with OSX Maps without the entitlement and Apple approved it -- but no Maps showed up on the production version!

In my case, I had the same problem, my solution was to change the 'Release Provisioning Profile' in the Build Settings before doing Archive. I do this twice, once for App Store distribution, and another one for Ad Hoc distribution. I also add a comment on my archives. My conclusion is that there is something broken about the "archive re-signature".

There is a very good tutorial for solving that problem on this website.
It says that this problem can occur when your Projects Bundle Identifier is different to the one you entered on the iTunes Connect Website.

I think xcode 5 uses "release" instead of "distribution" that you may created yourself.

If all above didn't work (in my case after couple of days no luck trying everything) I have only one Mac application. BE CAREFULL WITH REVOKE!
1) Revoke by hand all "Mac App Distribution" & "Mac Installer Distribution"
2) Clean relevant certificates and open-keys in Keychain (Warning: export before delete)
3) Restart Xcode
4) Go to (in Safari) developer.apple.com -> certificates etc.
5) Create CertificateSigningRequest.certSigningRequest in Keychain->Certificate assistant
6) Create by hand on developer.apple.com both "Mac App Distribution" & "Mac Installer Distribution" with your *.certSigningRequest
7) Provisioning Profiles -> Distribution -> create/fix custom provision for AppStore (I'm specially named it as "Mac provision profile for AppStore"
8) Xcode -> Settings -> Account -> Your account -> Refresh
9) Xcode Clean -> Archive -> Validate

I have been struggling with similar problem (I was building for Ad-Hoc distribution). Only thing that has changed since last successful deploy, was adding two devices to provisioning profile.
After double- and triple- checking all build settings, I regenerated provisioning profile (without changing anything), re-downloaded and it worked fine.
So note to self: if there is no logic explanation, you can always try good old IT voodoo.
I also recommend iPhone Configuration Utility, which despite its name, is useful for checking what provisioning profiles you have on computer.

ERROR ITMS-9000: “This bundle is invalid. New apps and app updates submitted to the App Store must be built with public (GM) versions of XCode 5.1.1 or higher and iOS 7 SDK. Do not submit apps built with beta software.

If multiple developers are using the same member center account. One of them can't use a certificate created by others cause they used a certificate request created using their computers.
You need to use a certificate created by you (certificate request
created using your computer).
Alternative, told them to send you the Developer Profile. not sure of the name. to use a certificate created on another computer.

Code signing Entitlements occur because of your resource does not contain Entitlements file in resources,Just go to build setting and search code signing Entitlements delete entry for debug and release, build project again you will see there is no error. Cheers

I had the same problem, but nothing written here worked for me. However, I found a simple way that worked for me. Here's how to do it:
1) In your Project and your Target(s) build settings, choose "None" for all Provisioning profiles, and choose "Don't Code Sign" for all Code Signing Identities.
2) Now, choose your Target and go to build settings. In Code Signing Identity Release setting, choose "iOS Distribution" for "Any iOS SDK". And then, in Provisioning Profile Release setting, choose your distribution profile for "Any iOS SDK". After that your Code Signing Identity Release setting should automatically change to "iPhone Distribution".
3) Archive your build and validate. Now it should work fine. That's it!

Related

No matching provisioning profile found error [duplicate]

Before upgrading Xcode to 7.2, I was using Xcode 7.1.1 to build and distribute apps. I have upgraded to Xcode 7.2 and none of my provisioning profiles (matched to that particular app's bundle ID) match my installed certificates that were working in Xcode 7.1.1.
I only get:
Your build settings specify a provisioning profile with the UUID “some_number”, however, no such provisioning profile was found.
I have tried regenerating a .certSigningRequest to generate a new Certificate and Profile and made sure the Team in the General tab of the target is correct. Whenever I select a Provision Profile, all of my Code Signing Identities appear in the Identities in Keychain, but none of them will pair correctly.
It seems setting the Provision Profile to Automatic and the Code Signing Identity to iOS Developer will resolve this error, but the advantage of managing my Provisioning Profiles is gone as I believe Xcode then manages these.
Any thoughts on why setting my Provisioning Profiles and Code Signing Identities to anything but Automatic and iOS Developer produces this error?
I also had some problems after updating Xcode.
I fixed it by opening Xcode Preferences (⌘+,), going to Accounts → View Details. Then select all provisioning profiles and delete them with backspace (note: they can't be removed in Xcode 7.2). Restart Xcode, else the list doesn't seem to update properly.
Now click the Download all button, and you should have all provisioning profiles that you defined in the Member center back in Xcode. Don't worry about the Xcode-generated ones (Prefixed with XC:), Xcode will regenerate them if necessary. Restart Xcode again.
Now go to the Code Signing section in your Build Settings and select the correct profile and cert.
Why this happens at all? No idea... I gave up on understanding Apple's policies regarding app signing.
Try restarting XCode first, before trying these other answers. I was about to follow the advice given in other answers, then noticed multiple people saying that restarting XCode was necessary after all the steps. All I did was restart XCode and it fixed the problem. Who knows if it'll fix the problem for you, but it's worth a shot before trying the other solutions. I'm on XCode 7.2.1.
Keep quitting Xcode until the damn thing works.
I've also the same problem, in Xcode 7.2
It solved by followings steps:-
1) Open Xcode preference,
2) Select the appropriate team,
3) Click the "View Details..".
4) In section "Signing Identities": click on "Reset" for each of them.
5) In section "Provisioning Profiles". Click on "Download All".
6) Click on "Done."
7) Go in Xcode, build settings, select it. In General tab, the issues should get removed.
8) Restart the Xcode.
9) Do the Final build.
That's all.
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer and add it to Keychain access > certificates (which expires on 2023)
Also after I did all of suggested steps (btw, for some reasons backspace not remove provision profile) error keeping occurring. Until I finally figured out to Restart Xcode.
Probably, it should be first step when you're dealing with Xcode :)
Using Xcode 7.3, I spent way too much time trying to figure this out -- none of the answers here or elsewhere did the trick -- and ultimately stumbled into a ridiculously easy solution.
In the Xcode preferences team settings, delete all provisioning profiles as mentioned in several other answers. I do this with right click, "Show in Finder," Command+A, delete -- it seems these details have changed over different Xcode versions.
Do not re-download any profiles. Instead, exit your preferences and rebuild your project (I built it for my connected iPhone). A little while into the build sequence there will be an alert informing you no provisioning profiles were found, and it will ask if you want this to be fixed automatically. Choose to fix it automatically.
After Xcode does some stuff, you will magically have a new provisioning profile providing what your app needs. I have since uploaded my app for TestFlight and it works great.
Hope this helps someone.
Check your Keychain - look in Login and System keychains for expired certificates or error messages.
I found certs with "this certificate has an invalid user" error messages, and an expired Apple Worldwide Developer Relations Certificate.
Delete them and install the new AWDRC certificate from https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
Then follow the accepted answer to get Xcode to use the new certificates.
For me I tried following 2 steps which sadly did not work :
deleting all provisional profile from Xcode Preferences Accounts → View Details , downloading freshly all provisional profiles.
Restarting Xcode everytime.
Instead, I tried to solve keychain certificate related another issue given here
This certificate has an invalid issuer Apple Push Services
This certificate has an invalid issuer
In keychain access, go to View -> Show Expired Certificates.
Look for expired certificates in Login and System keychains and an "Apple Worldwide Developer Relations Certification Authority".
Delete all expired certificates.
After deleting expired certificates, visit the following URL and download the new AppleWWDRCA certificate, https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
Double click on the newly downloaded certificate, and install it in your keychain. Can see certificate valid message.
Now go to xcode app. target → Build Setting → Provisioning Profile . Select value from 'automatic' to appropriate Provisioning profile . Bingo!!! profile mismatch issue is solved.
In my case, the problem was that the Archive was being built with a different TEAM-ID than the one who generated the Provisioning Profile (Me). Therefore I Got the error:
"No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID, however, no such provisioning profile was found."
To Solve this:
Clean and Re-Download your Provisioning profiles from Settings
Re-Start Xcode
in the GENERAL Tab of the Project properties, got to TEAM:
Change the current team to the Same team but the one under the ACCOUNT you generated the provisioning profile with.
Clean & Build
Viola!
Hope this helps someone.
I updated to Xcode v7.3.1 and it solved the issue.
With Xcode 7.2.1, if you are certain that your provisioning profile is correct (it has the correct App ID and certificate, and the corresponding certificate exists in your Keychain Access) then set the Code Signing Identity and set the Provisioning Profile to Automatic.
What I did was: created a new provisioning profile and used it. When setup the provisioning profile in the build setting tab, there were the wrong provisioning profile numbers (like "983ff..." as the error message mentioned, that's it!). Corrected to the new provisioning profile, then Xcode 7.2 refreshed itself, and build successfully.
Solutions described here work, but I want to add that you need to have correct target selected on the top left corner of Build Settings in Xcode. Lost some time figuring this out...
You can easily fix the problem by changing bundle identifier on the Apple web page from com.my.app to com.my.app.iOS. I found this solution at https://forums.developer.apple.com/thread/15712.
In Xcode 7.3 I got the same error, my certificate and provisional profile both were fine still I was getting the same error, I was unable to delete the provisional profile in Xcode preferences, so I tried by right-clicking on the provisional profile which shows the option to move to trash, but when I clicked nothing happened then I closed the preference window and open it again by Command, the provisional profile was gone and download option was visible, I clicked download and it starting working fine
When distribute to App Store, you choose Product -> Achieve and encounter "code sign error, no matching provisioning profiles found", if account and downloaded .mobileprovision file is ok. Try click the "Build and Run" button to run it on your phone.
And, a dialog box will popup with a button "Fix", just click "Fix" to do next... Last, your device will have an valid provisioning file. Just do "Product -> Achieve" again, everything is OK!
You can also simply go to xcode preferences then accounts and then it may ask you to simply re sign in with your developer profile and then the issues should go away.
Hope this Helps!
For me changing the build configuration from release to Debug solved the issue.
You can find Build Configuration in Edit Scheme -> Run -> Info -> Build Configuration
Clean your project and re run.
In addition to what other users posted, make sure the Team selected on the Target settings (General tab) is the correct one. Xcode will complain it cannot find the Provisioning Profile if the profile belongs to a different team than the one selected.
For me nothing above worked with XCode 7.3.1 because I had nothing in provisioning profiles (expired). I had to connect my iPhone to Mac and then click on Fix provisioning profile which created another profile expires in a week.
For everyone who didn't solve it yet, my Issue was answered by this:
https://stackoverflow.com/a/41202884/3953197
After I have a few hours searching and trying I have two solutions
1- run the app using IOS real device.
2- turn off the automatically manage signing, go to https://developer.apple.com/account/resources/profiles/, and create a profile now on the Provisioning Profile import it and done.
For me none of the solution worked, but If i disconnect the phone from laptop and then run the build, it succeeds and then I connect and run on the phone. I still couldn't figure out the final fix.

Xcode 7.2 no matching provisioning profiles found

Before upgrading Xcode to 7.2, I was using Xcode 7.1.1 to build and distribute apps. I have upgraded to Xcode 7.2 and none of my provisioning profiles (matched to that particular app's bundle ID) match my installed certificates that were working in Xcode 7.1.1.
I only get:
Your build settings specify a provisioning profile with the UUID “some_number”, however, no such provisioning profile was found.
I have tried regenerating a .certSigningRequest to generate a new Certificate and Profile and made sure the Team in the General tab of the target is correct. Whenever I select a Provision Profile, all of my Code Signing Identities appear in the Identities in Keychain, but none of them will pair correctly.
It seems setting the Provision Profile to Automatic and the Code Signing Identity to iOS Developer will resolve this error, but the advantage of managing my Provisioning Profiles is gone as I believe Xcode then manages these.
Any thoughts on why setting my Provisioning Profiles and Code Signing Identities to anything but Automatic and iOS Developer produces this error?
I also had some problems after updating Xcode.
I fixed it by opening Xcode Preferences (⌘+,), going to Accounts → View Details. Then select all provisioning profiles and delete them with backspace (note: they can't be removed in Xcode 7.2). Restart Xcode, else the list doesn't seem to update properly.
Now click the Download all button, and you should have all provisioning profiles that you defined in the Member center back in Xcode. Don't worry about the Xcode-generated ones (Prefixed with XC:), Xcode will regenerate them if necessary. Restart Xcode again.
Now go to the Code Signing section in your Build Settings and select the correct profile and cert.
Why this happens at all? No idea... I gave up on understanding Apple's policies regarding app signing.
Try restarting XCode first, before trying these other answers. I was about to follow the advice given in other answers, then noticed multiple people saying that restarting XCode was necessary after all the steps. All I did was restart XCode and it fixed the problem. Who knows if it'll fix the problem for you, but it's worth a shot before trying the other solutions. I'm on XCode 7.2.1.
Keep quitting Xcode until the damn thing works.
I've also the same problem, in Xcode 7.2
It solved by followings steps:-
1) Open Xcode preference,
2) Select the appropriate team,
3) Click the "View Details..".
4) In section "Signing Identities": click on "Reset" for each of them.
5) In section "Provisioning Profiles". Click on "Download All".
6) Click on "Done."
7) Go in Xcode, build settings, select it. In General tab, the issues should get removed.
8) Restart the Xcode.
9) Do the Final build.
That's all.
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer and add it to Keychain access > certificates (which expires on 2023)
Also after I did all of suggested steps (btw, for some reasons backspace not remove provision profile) error keeping occurring. Until I finally figured out to Restart Xcode.
Probably, it should be first step when you're dealing with Xcode :)
Using Xcode 7.3, I spent way too much time trying to figure this out -- none of the answers here or elsewhere did the trick -- and ultimately stumbled into a ridiculously easy solution.
In the Xcode preferences team settings, delete all provisioning profiles as mentioned in several other answers. I do this with right click, "Show in Finder," Command+A, delete -- it seems these details have changed over different Xcode versions.
Do not re-download any profiles. Instead, exit your preferences and rebuild your project (I built it for my connected iPhone). A little while into the build sequence there will be an alert informing you no provisioning profiles were found, and it will ask if you want this to be fixed automatically. Choose to fix it automatically.
After Xcode does some stuff, you will magically have a new provisioning profile providing what your app needs. I have since uploaded my app for TestFlight and it works great.
Hope this helps someone.
Check your Keychain - look in Login and System keychains for expired certificates or error messages.
I found certs with "this certificate has an invalid user" error messages, and an expired Apple Worldwide Developer Relations Certificate.
Delete them and install the new AWDRC certificate from https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
Then follow the accepted answer to get Xcode to use the new certificates.
For me I tried following 2 steps which sadly did not work :
deleting all provisional profile from Xcode Preferences Accounts → View Details , downloading freshly all provisional profiles.
Restarting Xcode everytime.
Instead, I tried to solve keychain certificate related another issue given here
This certificate has an invalid issuer Apple Push Services
This certificate has an invalid issuer
In keychain access, go to View -> Show Expired Certificates.
Look for expired certificates in Login and System keychains and an "Apple Worldwide Developer Relations Certification Authority".
Delete all expired certificates.
After deleting expired certificates, visit the following URL and download the new AppleWWDRCA certificate, https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
Double click on the newly downloaded certificate, and install it in your keychain. Can see certificate valid message.
Now go to xcode app. target → Build Setting → Provisioning Profile . Select value from 'automatic' to appropriate Provisioning profile . Bingo!!! profile mismatch issue is solved.
In my case, the problem was that the Archive was being built with a different TEAM-ID than the one who generated the Provisioning Profile (Me). Therefore I Got the error:
"No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID, however, no such provisioning profile was found."
To Solve this:
Clean and Re-Download your Provisioning profiles from Settings
Re-Start Xcode
in the GENERAL Tab of the Project properties, got to TEAM:
Change the current team to the Same team but the one under the ACCOUNT you generated the provisioning profile with.
Clean & Build
Viola!
Hope this helps someone.
I updated to Xcode v7.3.1 and it solved the issue.
With Xcode 7.2.1, if you are certain that your provisioning profile is correct (it has the correct App ID and certificate, and the corresponding certificate exists in your Keychain Access) then set the Code Signing Identity and set the Provisioning Profile to Automatic.
What I did was: created a new provisioning profile and used it. When setup the provisioning profile in the build setting tab, there were the wrong provisioning profile numbers (like "983ff..." as the error message mentioned, that's it!). Corrected to the new provisioning profile, then Xcode 7.2 refreshed itself, and build successfully.
Solutions described here work, but I want to add that you need to have correct target selected on the top left corner of Build Settings in Xcode. Lost some time figuring this out...
You can easily fix the problem by changing bundle identifier on the Apple web page from com.my.app to com.my.app.iOS. I found this solution at https://forums.developer.apple.com/thread/15712.
In Xcode 7.3 I got the same error, my certificate and provisional profile both were fine still I was getting the same error, I was unable to delete the provisional profile in Xcode preferences, so I tried by right-clicking on the provisional profile which shows the option to move to trash, but when I clicked nothing happened then I closed the preference window and open it again by Command, the provisional profile was gone and download option was visible, I clicked download and it starting working fine
When distribute to App Store, you choose Product -> Achieve and encounter "code sign error, no matching provisioning profiles found", if account and downloaded .mobileprovision file is ok. Try click the "Build and Run" button to run it on your phone.
And, a dialog box will popup with a button "Fix", just click "Fix" to do next... Last, your device will have an valid provisioning file. Just do "Product -> Achieve" again, everything is OK!
You can also simply go to xcode preferences then accounts and then it may ask you to simply re sign in with your developer profile and then the issues should go away.
Hope this Helps!
For me changing the build configuration from release to Debug solved the issue.
You can find Build Configuration in Edit Scheme -> Run -> Info -> Build Configuration
Clean your project and re run.
In addition to what other users posted, make sure the Team selected on the Target settings (General tab) is the correct one. Xcode will complain it cannot find the Provisioning Profile if the profile belongs to a different team than the one selected.
For me nothing above worked with XCode 7.3.1 because I had nothing in provisioning profiles (expired). I had to connect my iPhone to Mac and then click on Fix provisioning profile which created another profile expires in a week.
For everyone who didn't solve it yet, my Issue was answered by this:
https://stackoverflow.com/a/41202884/3953197
After I have a few hours searching and trying I have two solutions
1- run the app using IOS real device.
2- turn off the automatically manage signing, go to https://developer.apple.com/account/resources/profiles/, and create a profile now on the Provisioning Profile import it and done.
For me none of the solution worked, but If i disconnect the phone from laptop and then run the build, it succeeds and then I connect and run on the phone. I still couldn't figure out the final fix.

Xcode6 error: "No matching provisioning profiles found for application"

I'm trying to submit my iOS app in Xcode6. When I click Submit or Validate in the organizer, a window pops up that says:
Failed to locate or generate matching signing assets:
Xcode attempted to locate or generate matching signing assets and
failed to do so because of the following issues:
No matching provisioning profiles found for "Applications/MyApp.app”
None of the valid provisioning profiles allowed the specified
entitlements: application-identifier, beta-reports-active,
keychain-access-groups.
I have created a distribution provisioning profile for this app in the member center and it appears in Xcode.
I've looked around and have not found anything online that has told me how to fix this. Can anyone help? Thanks.
Andy
There's a couple possibilities for your issue, but the main causes is what I got from experience as well as other SO answers.
Your certificate or profile is outdated, in which case you have to go and regenerate your profiles again. I had this problem before, but Apple has described (partially) this issue.
You haven't set your profile in the Build Settings/Code Signing area, along with the appropriate certificates. Verify your Team in General/Identity and ensure that your profile is properly set.
From Xcode 5: Code signing entitlement errors (The image is a bit outdated, but its the same as Xcode 6):
You are using a beta version of Xcode.
#jaytrixz states: "I just removed Entitlements.plist in Code Signing Entitlements under Build Settings" which could possibly work. Be sure that your provisioning profiles are configured as well.
As jaytrixz, wrote in the comments...
"I just removed Entitlements.plist in Code Signing Entitlements under Build Settings "
I did the same and it worked after an hour of trying other things!
There are a lot of answers here, some have worked for me in the past, but not this time. I'd even created a new provisioning profile but that still did not help.
Based on the "None of the valid provisioning profiles allowed the specified entitlements" part of the error I tried the following on a hunch and it worked for me:
1. add and remove a particular Capability
Go to Targets > Capabilities, and turn one on and then off.
I doubt it matters which you choose, I added "Push Notifications" (which I don't need for my app), once it was "ON", I changed it back to "OFF"
2. Archive again
I am now successfully uploading my app to the store.
Another solution, that fixed this symptom for me, can be found at: Xcode Watchkit: None of the valid provisioning profiles allowed the specified entitlements: beta-reports-active, com.apple.security.application-groups
Briefly: clear ~/Library/MobileDevice/Provisioning Profiles
If you are sure you have valid certificate and provisioning profile, then you may need to do the following:
I would suggest people to refresh the link between xCode and developer account by doing the following:
Go to Xcode -> Preferences -> Account -> View details -> (Refresh icon)
Otherwise you may not be able to see the provisioning profile as an option in the build settings (You may only see old profiles)
A lot of times it gives me connection error, you may need to retry.
Do this refresh every time you edit the provisioning profile or certificate online on apple developer member center
If certificates and build setting are all good, and you are part of multiple teams, make sure to select the proper team for the app.
Clean and archive again.
I had another cause for this problem.
I had 3 different Configurations (Debug, AdHoc, AppStore). I accidentally had the AdHoc Configuration selected in the Archive Scheme setting and tried to upload the generated archive to the AppStore.
So setting the Archive configuration to AppStore solved the problem for me.
It's the year 2017, and the provisions are still not just working. I had to put them on manual mode because automatic didn't worked after struggling half an hour. I have no idea what are those entitlements, i have no entitlements file.
After trying every possible fix in the world, I ended up just adding this to the entitlements file:
<key>beta-reports-active</key>
<true/>
Find the right entitlements file by looking in Targets > Build Settings > Code Signing > Code Signing Entitlements.
Maybe it's something to do with this Apple doc, although I couldn't follow the instructions fully as certain things were missing in XCode 7 (e.g. the refresh icon in Preferences > Accounts).
Another possible cause for this message is if you accidentally did remove the 'target inclusion checkbox' for the entitlement file – in that case the error message is slightly misleading...
In my case, the problem was caused by different Bundle Identifier in Target General tab than in Build Setttings.
If you have only development provisionning profile, just create distribution also
I played with fastlane gym, and there it gave some interesting insights:
There was an error exporting your application Unfortunately the new
Xcode export API is unstable and causes problems on some project You
can temporary use the :use_legacy_build_api option to get the build to
work again
This is the according Bug-Report. Seems to be unfixed for month.
https://openradar.appspot.com/radar?id=4952000420642816
Building the app in legacy mode worked for me.
gym --use_legacy_build_api true
Hope, this helps anyone.
In my entitlement file for Health kit there was development key. I removed that and my problem resolved.
I hope this answer could help :)
There seem to be many possible causes of this error.
In my case, my app was an Enterprise release and I was clicking "Validate" when I should have been heading straight to "Export".
I found this in the Apple docs:
Validate or Submit is not intended to be used with Development, Ad Hoc or Enterprise builds. Ad Hoc or Enterprise distributions should skip straight to Export.
Source: https://developer.apple.com/library/content/qa/qa1830/_index.html
I ran into this issue using App Groups. To resolve, I had to log into developer.apple.com and reassign the App Group ID to my App ID.
If other solutions do not work, try going to XCode -> Preferences -> Accounts -> View Details
Now look in Provisioning Profiles section. If your provisioning profile has an action button of 'Download', click the button and download. Then try again
Create a new provisioning profile
This solution worked for me when I had this problem.
Step by step :
log onto the apple developer portal and go here : https://developer.apple.com/account/ios/profile/production
Click the [+] add button and fill in a new profile name and select your app ID
Click the Download button, and once it has downloaded double click to open that file in Xcode
Re-Archive, and this time you should be able to upload succesfully to the store

iOS - cannot validate my app "No identities are available for signing" [duplicate]

I have an error "No identities are available for signing" when try to validate my app in Xcode 5. I tried all: Recreate certificates and provisioning profiles, all methods which have been described on this site and another resources; I'm confused, because when I try to distribute my app as Ad-hoc, it successfully create and install on test device an IPA file. But when I try validate my app or submit to AppStore, all the time I have an error. Maybe someone can help me with this issue.
All you need to do is:
go to Certificates, Identifiers & Profiles in the Developer Center
create a new provisioning profile in "Provisioning Profiles" / "Distribution"
download the profile and open it
restart Xcode
Please make sure you are using distribution provisioning profiles, rather than Development.
And the code sign setting in Xcode is compatible with the distribution provisioning profiles.
The validation process does not work with Ad-hoc profiles. Need to create a Distribution provisioning profile. It is not specified in the instructions for beta testing. I agonized all day until realized.
Use the Application Loader (Xcode -> Open Developer Tool -> Application Loader).
Also - this answer/question may also be helpful for you:
https://stackoverflow.com/a/18914073/730172
Restarting Xcode solved the problem for me! Restart and/or clean solves 99% of all issues...
#CainaSouza 's comment above worked for me. I didn't even have to create any new provisioning profiles.
I just had to go to Xcode > Preferences > Accounts > (Apple ID) > View Details and hit the refresh button. After a minute or two it was done and had loaded my provisioning profiles. I didn't even have to select it in my project options, it had already selected my most recently generated one.
Clean your Product Build Folder (with Alt button)
Restart Xcode
It solved my same issue
I had a similar issue. Found out that the bundle identifier did not match the app id that was on itunes connect - it was capitalized differently. Fixed the issue by making the identifiers match.
Yes the appID and bundle identifier must match. Remember it is CASE-SENSITIVE. That was the problem for me.
I updated to Maverick and Xcode 5 and had the same issue even though I had everything ok in Profiles. I created a new Distribution profile (identical to the old one), added it by refreshing profiles and the issue was solved without rebuilding.
Apple Decided to "Magically Dissapear" my distribution provisioning profile from their site after upgrading to a newer Xcode, giving me this problem too.
Solution is obvious only once I had discovered this fact!
-Create new Distribution Provisioning Profile
-Download & install it / Refresh Xcode preferences under account details
I fixed this issue by delete the old development/distribute profiles and create new one with new names.
I had a mismatch between the Bundle Identifier within Xcode and the App ID on Developer.Apple.Com (Certificates, Identifiers & Profiles). This StackOverflow post was a great help to me. For a little extra info check out this blog post. The official documentation for the touch command can be found here. I had quit Xcode before doing the below. Upon completion of the details below and reopening Xcode my issue was resolved.
Use a text editor to update the bundle identifier to match the App ID, the Info.plist file is located:
ProjectName > ProjectName > ProjectName > ProjectName-Info.plist
Your looking for the following lines:
<key>CFBundleIdentifier</key>
<string>MyCompany.${PRODUCT_NAME:rfc1034identifier}</string>
Update the value to match you App ID, eg:
<string>com.MyCompany</string>
Use the terminal to issue the touch command, ensure your within the above listed directory:
touch ProjectName-Info.plist
If you are using Xcode 5.1 or above (which you would be now), this helped me: Code signing broken on Xcode 5.1 + iOS 7.1
The key is to delete the old provisioning profile on your mac and create a new one (with a different name?) from Apple web site and download it. Looks like Xcode 5.1 corrupts the existing provisioning profile and it does not help even if you re-download it again.
My solution was to go into the dev center, find the distribution provisioning profile, and it had expired. So i tapped edit on it, and renewed it, downloaded it, installed it, chose the profile in the build settings, and it worked.
HTH someone.
Of all the development issues I've faced over my 20+ years as a software developer, none have wasted so much time as the code-signing/provisioning profile rubbish in Xcode.
This week, I have wasted 8+ hours trying to build an Ad-hoc release of our iPhone app. In the past, it just worked, I could Archive, stick a download button on our in-house webpage, and users could just install our app from this page.
But, this week, I was facing the same "No identities are available" issue, described here.
EVENTUALLY, here's what solved the issue for me:
When I logged into the hopeless Apple Developers website, it showed that our company had 2 "iOS Distribution" certificates. They were valid, their expiry dates are months away, and in the Keychain Access application, the certificates were installed and valid... no problems here.
But what fixed my issue was to delete these two certificates, recreate a new one, then recreate my "In house" Provisioning Profile (as the original one was now showing as being invalid, as it used the old "iOS Distribution" certificate).
I also went into the "Keychain Access" application on my MacBook, and deleted all "iOS Distribution" keychains.
Then, I downloaded the new certificates & provisioning profiles, now, finally, Xcode would report that there was an identity which I could code-sign with.
To the Xcode development team:
Please. Get this fixed.
If a developer like myself, is up against a wall, unable to get a valid Provisioning Profile, which will result in a downloadable app, which will fail each time on "The app couldn't be downloaded at this time" message.. DON'T allow the Archive function to be used.
Instead, TELL the user what the problem is. HELP them resolve it, rather than going through the motions, and happily allowing them to create Archives which will never be useable.
And if an Ad-Hoc install is invalid, please put something in the Log to explain what's gone wrong, and make this accessible from Xcode. Currently your "The app can't be downloaded at this time" message is both useless and misleading.
One last thing (if this helps):
Our company accidentally let its Developer Enterprise Program license expire last month. We did then renew, everything was seemingly okay again, but perhaps, behind the scenes, this messed up our "iOS Distribution" certificate ? And perhaps, not. From the Apple website's point of view, everything was fine.
My issue was that I had none.myApp in my Bundle Identifier whereas in the AppID, I had com.myApp.
This drove me crazy for hours.
I ran into this issue today and it seems to be related to the face that the profile started with a number. I deleted the profile and recreated it exactly the same way (after a lot of other troubleshooting steps found on SO) EXCEPT this time I started with a word instead of a number. Coincidence? Not sure but worth trying.
Had this yesterday and could not figure it out, no matter what I did! To solve the problem, I went to both the Project and the Target in Xcode, and under code signing, chose
Code signing identity: Don't code sign
Provisioning profile: None
Build, and then Product > Archive, and now Organizer chose the correct code signing identities and profiles to allow it to get to the Validation step. Woohoo!
It happen to me after update Xcode.
I fixed doing the follow
change the sign in to "no sign"
restart Xcode
set it to the correct sign
re-archive the build
I hope it helps
Apple Documentation
"If Xcode doesn’t find signing identities, a dialog stating “No identities are available for signing” appears. Verify that you have a distribution certificate and an ad hoc provisioning profile before continuing.
If your ad hoc provisioning profile doesn’t appear in the Provisioning Profile pop-up menu when you create the iOS App Store Package, refresh the profiles in Xcode, as described in “Refreshing Provisioning Profiles in Xcode.”"
In my case, the adhoc provisioning that I wanted to set was not selectable in Code Signing in Build Settings. Though, I created and downloaded the adhoc provisioning from developer store. The answers mentioned here didn't work for me. Fix Issue button in General tab fixed the issue by downloading the required adhoc provisioning file by itself.
Creating a new certificate, Profile in Apple development center did not work for me! I tried editing a profile/certificates and download again and double click to install in KeyChain, but still did not work. I restarted XCode (Version 7 and Mac on El Capitan), restarted Mac but still did not work!
What worked for me is:
XCode -> Preferences -> Accounts - Then I deleted the Apple ID.
Shutdown my Mac, and restarted it.
Started my XCode, added the Apple ID, went to view details in Apple ID's and downloaded the Provisional Profile again and only then it started working!
Restarting solved my problem. I have a new mac and tried downloading the profiles, which should've transferred anyways. restarting solved it.

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