The identity used to sign the executable is no longer valid at Xcode - ios

I tried to run the program on my device and I got that error The identity used to sign the executable is no longer valid. I have tried all discussions provided in this link. All didn't work for me. I deleted all developer certificates and get new certificate from Apple and put it into the keychain. Then I made new development provisioning profile as Xcode iOS Wildcard App ID (to be generic). The status is active at Apple's developer site. So I put it into provisioning profile. I choose the correct certificate and profile at Code Signing from Build Phases at Xcode. I did all what I can think of, but that error never disappear. My Xcode version is 6.4 and my iOS is 8.4, all latest versions. What could be wrong?
Thanks

Check device UDID is correctly added and also check if device is added in provision profile or not

All what they post above are correct. The problem sometimes depends on some small issues individually. For me how I solved is
(1)I started from scratch. All certificates, app id , provisioning profile etc everything I made new in the portal. In the step making provisioning profile, profile should link to certificate and your device.
(2)Then need to check the development certificate is valid. Sometimes, the certificate is not valid immediately. For that, I reset the system clock and timezone at both device and Mac pc. I am not sure because of resetting the clocks at both devices or not, when I reboot the systems the certificate became valid. Then it works afterwards.

I went to the portal, deleted all of my certs (no live apps currently) and used the 'create' btn from the accounts menu:
Preferrences | View Details | Action => 'Reset'

Remove your apple id from Xcode preference and add it back again. Clean, rebuild and make sure coding signing is correct in project settings. That works for me.

I have solved the same problem. Just from "https://developer.apple.com/account/ios/profile/production/create" re-created the new Provisioning Profiles. Then download and install the new Provisioning Profiles of (Development and Distribution).

Related

Appcenter iOS install error "this app cannot be installed because its integrity could not be verified"

I see that this question has been asked many times but I see no solution that works for me so I'm hoping that providing more info might shed some light.
We use appcenter.ms to test iOS apps. Until our iOS certificate expired this method worked fine. We generated a new enterprise certificate and ad hoc provisioning profile for new releases of the iOS app. Which led to the first curiosity.
I see how to upload a certificate on appcenter.ms but not a provisioning profile. I thought there was an option to do this in the past but perhaps I am mistaken. However, the app is signed with a provisioning profile before upload, so perhaps this is not needed now.
Once the app is uploaded, it can't be installed. It remains grey and when you tap it, you get the "this app cannot be installed because its integrity could not be verified" error. Again, that the .ipa is created with an ad hoc certificate and profile in Xamarin (VS for Mac).
Also, I can't install the provisioning profile on a device from appcenter.ms. You basically get stuck in a loop where you seem to successfully install the profile but have to keep doing it because it never actually installs.
I hope this is enough info for some insight and thanks in advance for any feedback.
We were able to solve this by redoing and downloading development certs and via
And also downloading and double clicking the apple development certificate here
After that our keychain showed both as trusted and we could build to the iPhone again.
The issue can be the your device is simply not registered on the developer portal and/or that ad-hoc provisioning profiles have not been regenerated.
You need to register your device, regenerate a provisioning profile with this device in it and rebuild your app using this profile.
This can also happen because of
Developer ID Notary Service - Outage
which can be checked on https://developer.apple.com/system-status/
Notarization is well explained here:
Notarization gives users more confidence that the Developer ID-signed
software you distribute has been checked by Apple for malicious
components. Notarization is not App Review. The Apple notary service
is an automated system that scans your software for malicious content,
checks for code-signing issues, and returns the results to you
quickly. If there are no issues, the notary service generates a ticket
for you to staple to your software.
Work around fix:
Select your app.
Navigate to TextFlight tab
Create External Testing group
Add one tester
Add build which you want to download using TestFlight
Open TestFlight and download an app.
In my case this was caused by trying to include an entitlement for aps-environment "development" when using an Ad-Hoc provisioning profile. The value for this environment in Entitlements.plist must match what is hard coded into the provisioning profile file - if you open an Ad-Hoc profile in a text editor you will see it expects the "production" environment.
The possible solutions depending on your requirements are to either use the Development profile/certificate, or change the aps-environment to "production" to continue using an Ad-Hoc provisioning profile.
It can also happen if you have other incorrect entitlements - worth checking what entitlements are enabled under the Identifier in Apple Developer portal and removing unnecessary ones.
I had this issue because when building the app on xCode for distribution (Product->Archive then Distribute App), I chose automatic signing. After manually signing the app and choosing my own generated certificate and profile, everything worked again fine.
I removed the Entitlements file from the Addition Resources in iOS Bundle Signing and it worked.
I think the MSAL configuration was set to debug in entitlements.plist
I have also face this issue before but for me the reason was little different
First the build was enterprise one and the build was made on the earlier Xcode version on which the iOS version you are using on the device was not supported by the Xcode.
All I did was to update my Xcode and make a new build and shared the build. After that we were able to install that build over device Hope it works for you as well
This is how I solved for myself.
In you iPhone Settings > General > VPN & Device Management you should see your company name (if an app from it is installed), and if you click on it, you will see a button like "Verify" above the list of apps installed provided by the company. Just click on "Verify".

Xcode 7: App installation failed: A valid provisioning profile for this executable was not found

I have already searched and almost implemented max solution but it's not installing any app even though if I am creating just sample single view app.
App installation failed
A valid provisioning profile for this executable was not found.
============== update ====================
I fixed this issue today.
First, go to ~/Library/MobileDevice/Provisioning Profiles.
Make sure Xcode isn't running.
Then, delete all provisioning files (like xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.mobileprovision).
Start Xcode.
You will see something like "Fix this issue" in your Target's General tab.
Click it.
Xcode will now load new provisioning profile.
That's it.
----------- OLD Answer -------------
I have same problem now.
I've checked my provisioning profile using https://github.com/chockenberry/Provisioning/releases.
In my case, my provisioning profile had the wrong UDIDs but right machine count.
I've registered machines, and Apple Developer Center listed right UDIDs for those machines.
However, whenever I downloaded new provisioning profile, it contained wrong UDIDs.
I think Apple's system is outputting wrong provisioning profile.
I called Apple support for this issue today, but Apple only emailed me with their knowledge base links(forums,documents,etc).
Possibly you are using App Store distribution provisioning profile. Use development or Ad-Hoc provisioning profile.
For Xcode 8 / Swift 3.0
In my case, for my app target and my extension in "General" I check "Automatically manage signing" and it work
I was having this issue because the date/time on my iPhone was not the same as that on my Mac running Xcode ( i changed the date on my iPhone while testing some app).
On my iPhone, i went to Settings > General > Date & Time > Set Automatically
This fixed it
Make sure you have added device UDID in your provisioning profile.
Go to provisioning portal.
Edit provisioning profile.
Make sure device is checked.
Done, download
Use new Profile
Another possible reason: Device date is set to later than the expiry of you provisioning profile.This is very weird but, it could happen.
In my case it was that the running option in the building scheme was set to Release so it was trying to sign it using the appstore provisional profile not the development or the adhoc one. I had to set it to Debug to fix this!
I could run on Simulator just fine, but trying to install the App on device was throwing this exact error.
I had a test target in addition to the main target. The test target had signing set to a different team and profile. Setting the unit test target to match the main target settings for signing solved my issue.
Didn't notice it had been automatically changed over to a different team, was caused by being added to a new Enterprise team.
In my case, I went to the Apple Developer website and added the phone to the Provisioning Profile.
Then I re-downloaded the Provisioning Profile and worked =)
In my case was The build system. I had to change the default build system in "File > Project / Workspace Settings" and change it to the Legacy Build system.
For me, it's because the project I was trying to build is someone else's. The bundle identifier does not match with my team's provisioning profile.
Change bundle identifier to something else help.
In my case, my certificate is overdue..
The following worked for me:
Install the app using Personal provision profile (re-install after going into your phone settings and trusting the profile)
Delete the app from ypur phone
Switch back to registered developer profile and try again
In my case iOS 14.4, rebooting the iPhone solved it.

iOS Provisioning profile: Valid signing identity not found

I am trying to test the push notification functionality on a device. I followed this article. http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
So the issue is when I download the development provisioning profile and import it into xcode then it says the valid code signing identity is not found.
This stops me from building the app as General projects settings says no matching provisioning profiles found.
No matter how many times I push fix button this wont go.
The app ID and provisioning profiles looks good on iOS Dev center.
I have tried deleting them and recreating them again and again but issue remains the same.
Also my build settings are:
There is only one option for code signing identity and that is "iPhone Developer" as no other matching code signing identity is found. I have tried deleting the app and recreating it in xcode also. I have double checked the bundle ID. And I have google a lot. Everyone says revoking the certificate and recreating fixed the issue but not in my case.
Also the keychain seems to have the correct public and private key.
I am stuck on it for last 2 days :(
Make sure to delete the old .cer file from you Keychain and download the latest one.
If the CertificateSigningRequest.certSigningRequest is created from another machine, get the corresponding .p12 file and add it to your Keychain.
Thats it. Now double click on your provisioning profile and it should be valid.
Worst solution:
If you are unable to get the .p12 file, Revoke your existing certificate and configure all again.
Fixed it by deleting all development certificates in iOS dev centre (even my iOS development certificate) and recreating new ones from beginning. I had 2 iOS development certificates and I think Xcode was confused about which to use. This happened because I have revoked my development certificate from another machine and thus creating a new one. Somehow it ended up in two developer certificates managed by xcode. Since then i have'n tested any app on device and so though that was the problem.
Install the valid p12 file (i.e) double click the valid p12 file.

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.

The identity used to sign the executable is no longer valid

I have an application that I am debugging on iPad.
2 days ago I wanted to debug a same updated application but I am having this error.
The identity used to sign the executable is no longer valid.
Please verify that your device’s clock is properly set, and that your
signing certificate is not expired.
(0xE8008018).
I don't have iPhone Developer certificate yet, but I have debugged this game once.
Neither restarting Xcode nor restarting my Mac helped.
Solution within Xcode:
In Xcode, go to Preferences --> Accounts --> View Details
Press the + symbol and select iOS Development
Press the refresh button in the lower left corner (called Download all in Xcode 7)
PS:
Sometimes it may also help to delete invalid provisioning profiles: right-click -> move to trash
I saw this error exactly one year after signing up as an Apple developer.
Try restarting XCode. It worked for me.
This may happen when your certificate expire in your Key Chain.
EDIT : I'd now recommand cert and sigh to generate your certificates and provisionning profiles. These are two commands part of the fastlane tools from KrauseFx.
Using cert & sigh:
Open a terminal and type cert
Answer the prompted questions to sect your user, password, team, app, etc.
Open a terminal and type sigh
Answer the prompted questions to sect your user, password, team, app, etc.
Select the right profile in Code Signing Identity (iPhone Developer)
Conventional way:
Just go to the new provisioning portal : Certificates, Identifier, Profiles
Login with your developer account.
Go to Certificates and click the Plus button.
Then select iOS Apps Development and click Continue.
Follow the whole process and download the newly generated certificate.
Download it and put it in your keychain.
Update your profiles from XCode Organizer devices window
Select the right profile in Code Signing Identity (iPhone Developer)
If all the above previous suggestions fail after renewing your certificate, as they did for me, browse to the following location;
~/Library/MobileDevice/Provisioning Profiles
...and delete your provisioning profiles.
Then download your provisioning profile again from;
https://developer.apple.com/account/ios/profile/profileList.action
If you are using jailcoder, make sure you jailbreak your iphone successfully. Don't forget install AppSync for IOS in Cydia.
In the latest update from xcode this problem usually occurs when your certificate has expired and xcode continues to use the old one until it has expired.
Closing xcode and opening it again will fire off an automatic process of downloading your new certificate and getting your app working.
Just close xcode right down (Cmd + Q) then open it back up again, load your project and hit play .. it will ask you if you'd like assistance to auto fix the certificate problem then you just follow the onscreen instructions and it does all the hard work for you :)
You have your provisioning profiles outdated.
xcode
Preferences
Accounts
Select your apple id
View Details (Right-bottom corner)
Download All
Run again and DONE!
This may be somewhat of an empirical approach but is worthwhile in the face of many commentators noting either "this worked for me" or "this didn't work for me". Firstly, the problem can lie in a number of locations, either your certificates (code signing identities) or your provisioning profiles. Identifying where the problem lies first before doing anything will save a lot of wasted effort. You will need to check in three places:
XCode
Keychain Access
The Developer Portal (Developer Members Centre)
OK, in XCode click on the Project (Above the Targets Heading), select Build Settings and scroll to 'Code Signing'. Expand the 'CODE_SIGNING_IDENTITY' heading and you will see a bunch of identities (Debug, Release etc.) Each one of these will match up with a certificate in Keychain Access. Find the match and check the expiry date...if it has expired you will need to update it in the Developer Portal and download it. Check EVERY identity, not just the first one you find that has expired. Also, if it has expired you will need to regenerate any provisioning profile that used the expired certificate.
If no problems with the certificates, check the expiry date of all the Provisioning Profiles. Once again, if they have expired, they will need to be regenerated.
Once complete, repeat the same process for the TARGET you are trying to build for.
None of this worked? An expired certificate is lurking in one of your provisioning profiles. A sign that this might be the case is that when you click on a CODE_SIGNING_IDENTITY the identity is below Other... eg.
This is usually a sure sign that there is an expired certificate lurking about and that one of your profiles is using it.
I faced to this problem when my membership was expired and I renewed it. I use xCode6 and I solve this problem by revoking expired developer certificate from Member Center and cleaning build folder ( alt+[Product>Clean] ). xCode handle others issue itself.
See "Replacing Expired Certificates" section on this link:
https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html
I had this problem with XCode 6.3 Below is the steps that worked for me.
Go to XCode > Preferences > Accounts Select your developer account then click View Details... Click on the refresh button on the left bottom of the window. It should notify you that you're missing few certificates. Click Request. XCode automatically should download missing certificates. Click Done and it should work.
you debug it on simulator only if you don't have iPhone Developer certificate. check on left corner in
xcode you select simulator not device.
I faced the same issue, I deleted all provisioning assets from xcode & added them back, and just relaunched Xcode.
My App was loaded on to the device and it worked.
This does also happen if your developer certificate is expired. Time to pay apple and renew it :P
First: go to build settings and check, if your valid Code Signing Identity is chosen.
If that doesn't help, try the more complicated stuff
In my case, this dialog message worked
The identity used to sign the executable is no longer valid.
Please verify that your device’s clock is properly set, and that your
signing certificate is not expired.
(0xE8008018).
My certificate in Keychain Access was given status to be not valid yet in red color with expiry about one year and an hour in future. I set my time to be one hour ahead and status of the certificate became valid in green color. So, anyone out here who thinks the solution to be the xcode restart is not correct but it would be cause of time elapsed of the xcode restart to make the certificate valid. As, by clicking the Fix Issue button revokes and creates new certificate with exactly one year ahead (plus some minutes depending upon locales to raise this issue).
My solution, after nothing else worked, was to go to Keychain Access and delete all "iOS developer" keys/certificates, then let Xcode regenerate them.
Try setting the time on the mobile device and the Mac to "set date and time automatically" checkbox and restart xcode, that did it for me
The Problem here is that your profile was built on an expired certificated
-so you have to go inside the developer portal and renew your certificate if it was expired
-then regenerate the profile so it will be rebulit on the new certificate
i suggest to use the iPhone configuration utility tool to manage profiles on your mac
If your certificate is not installed locally. Or you tried running the certificate and opted to "revoke and request" a new certificate then you have the option to do that on the machine you are trying to run on
go to Preferences-> Accounts-> under your AppleId -> View Details -> under signing identities you can see the status of your certificate "Valid" or "Revoked" if revoked and you want to request a new one go to the -> + then -> the type of distribution you are trying to use.
In Xcode 5.1 - there is a self help area that did the job for me.
You'll find it in the General section after clicking on your project name under > Targets.
You should see a warning icon and a description of the issue in the Identity section (right where you type in your build/version numbers).
It noticed that there was no certificate currently stored and via some self-help boxes and a change of my password, I got it going.
These were the reasons I had this error:
The App ID didn't have my iOS Developer Certificate checked (I'm a member of an Enterprise program) and I had 2 provisioning profiles with the same App ID in my Mac. I deleted one.
Hopefully this helps someone.
I tried all of the above. I kept getting the error about the UUID not being found.
I went to the project, opened project.pbxproj and found all instances of the UUID (2) and deleted the UUID (not the entire line).
Fixed the problem.
I fixed this issue by selecting the correct team within Xcode (I'm part of multiple teams). Also, I revoked my certificate, requested a new one, uploaded that, and then re-downloaded it.
Experienced the same issue. Was an issue with an expired certificate. You'll need to create a new cert and corresponding prov profile. Follow dulgan's advice for doing so.
Removed the profiles from the directory on your machine: "~/Library/MobileDevice/Provisioning Profiles". And logged to apple developer centre and edited the specific provisioning profile and selected the certificate for provisioning profile and generated the profile again. Installed the new profile and it worked for me.
Found another way this occurs today. When you edit your provisioning profile after a certificate change you can see the certificates selected says 2 of 1 certificates selected (if you just use 1 certificate). Just by unselecting and reselecting the certificate you can regenerate and install the profile and it solves the problem.
#vomako 's solution almost solved my problem but I had to take another couple of steps.
I refer to the following...
In Xcode 6.1.1, I went to Preferences --> Accounts --> View Details
After upgrading to Xcode 6.1.1, the main issue for me that the >View Details button was greyed out.
I had to delete my account, restart Xcode, then add my developer account back in.
After this step, I could yet again view details and refresh my provisioning profiles.
I selected None from Team dropdown in target general settings. Then selected the original team. Xcode shows some spinner next to it. Wait for it to complete and then everything works. Tried it in Xcode 6.2
I had this problem several times, normally it can be solved by close-reopen Xcode.
I did delete derived data from Xcode organizer. It eventually works
Today I faced this issue on my Xcode 6.3 public release.
I tried to restart Xcode several times but issue remained there.
What worked for me is
Manually create a new development profile at "http://developer.apple.com"
download and install this new profile, select this new profile from xcode build and run.

Resources