no valid 'aps-environment' entitlement string found for application when trying to enable push notifications - ios

I've been reading all the other questions asking about this error and it seems like I've followed their solutions but I'm still having this problem. I removed all the existing provisioning profiles and app ids. I created a new app id that has push enabled. I created a development provisioning profile with push enabled. On the Apple dev site, that provisioning profile has a green "active" indicator next to it. In xcode5, under preferences>accounts, the provisioning profile is listed. Under window>organizer, the provisioning profile appears under my device with the status "valid profile". But the error is still occurring. What am I missing here?
Edit: I want to make it clear that I created my provisioning profile AFTER creating the APNS certificate since that seems to be the most common solution to this.

Of course I figure out what's wrong right after typing a question - the bundle identifier in xcode did not match my appid, and I forgot to update the certificate I uploaded to urban airship after restarting the configuration process.

Looks like you fixed the issue, but I got this issue when I moved to a new machine. Turns out I forgot to bring some certificates from my old machine. I fixed it by importing certificates from old to new.
Steps are:
Export certs on old machine as .p12.
Copy them to new machine.
Double click on file(s) to put them in Keychain Access on new
machine.
In Xcode on your new machine, go to Xcode > Preferences > Accounts, then
refresh the provisioning profiles.

Related

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

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).

Xcode 6 App Store submission fails with "Your account already has a valid iOS distribution certificate"

I'm using the latest XCode (6.1) and I need to submit the app as soon as possible, but I can't seem to get around the "Your account already has a valid iOS distribution certificate" error.
I have the client's provisioning profile and I have his distribution certificate (which is valid) and his private key (I've checked using Keychain, it's definitely there). The bundle ID is also correct. I've deleted my provisioning profiles and certificates and reinstalled the client's many times now.
What could be causing this issue? I've seen a lot of topics here on SO with this problem, so I apologise beforehand for creating yet another clone, but I really don't know how to fix this.
edit: I'm running a brand new install of Yosemite by the way
Got it solved by editing the iOS Distribution Provision Profile in the Developer Member Center.
For some reason there were 2 certificates to choose from for the Distribution Provisioning Profile. I switched over to the other certificate and I could Validate and Submit my Archive build for beta testing.
So, you may have more than one certificate for signing your Provision profiles. Make sure you have the right one (by trying all of them) and hopefully that should work.
I tried many things like Exporting Developer profile from Xcode Accounts and importing it in the organizer, installing the provision profiles from the member center, adding them to my keychain. But none of those worked. It started working only after editing the appropriate Provisioning Profile manually.
You could also trying removing all your available Provisioning Profiles and let Xcode create new ones for you. This will work too.
I also had this issue, which turned out to be caused by an attempt to export for ad hoc deployment using a development provisioning profile instead of a distribution profile. It seems this is no longer supported in Xcode 6.1. Once I created an ad hoc profile and installed that the problem went away. A more useful error message would have saved me hours of work and would be greatly appreciated, Apple.
This thread was helpful:
xcode 6 beta 2 issue with exporting ipa "Your account already has a valid iOS distribution certificate"
Besides all the other answers, there's one more possibility after 2/15/2016: the old World Wide certificate expired and I guess everyone has already downloaded the new cert (or check this out). However, you'll be seeing this error if you haven't remove the expired one. You may need to choose View -> Show Expired Certificates to unhide expired certs. If the error is still there, try regenerate provisioning profile as advised by the others.
I was moving to new Mac when I faced this issue.
On your older Mac:
Go Preferences > Accounts > Select Account > Details.
In the dropdown right click on iOS Distribution (or whatever is the name of your distribution certificate).
Export...
Set a password for the .p12 file.
Move and install this .p12 in the new mac.
Try Again.
Another possible cause for the problem (at least in my case) was that in my Keychain Access, I had two certificates for the team I was working with. One was expired, and the other one was the one I wanted to use. Deleting the expired certificate in Keychain Access solved the issue.
I ran into this problem, and I wanted to avoid screwing up my push notifications.
The easy fix for me was to just go to developer.apple.com > project > certifications, ids, and profiles > profiles > create a new profile (for development or distribution)
Download the created profile, drag and drop the profile over the Xcode icon, and then in your project target, set the new profile as the provisioning profile.
This fixed my problem--it may provide further help in the future.
The error message could mean that you need to get the Distribution certificate and private key from the developer who created them.
This can happen if some other team member has pressed the enticing "Reset" button (which means revoke certificate and create a new one).
Here is a picture what the revoked certificate looks like:
You can export the valid certificate from the developer who created
it and import it to other team members keychains.
Go to "Keychain Access" app.
Click on the "Login" in the top left box
Click on the "Certificates" on the bottom left box
Check which team member has the valid certificate:
when clicking on the "iPhone Distribution" certificate
everyone else sees "This certificate is revoked" in red at the top.
(Maybe backup the deleted certificate to avoid doing anything irreversible)
delete the revoked certificates
Export the one valid certificate and distribute to team
Import the certificate file for everyone else
Today I was solve problem by delete from keychain old certificate Apple Worldwide Developer Relations Certification Authority and install new one (exp. in 2023)
I'll add to here because while the accepted answer got me on the right track it wasn't the solution. There was a second (automatically created by Xcode) distro cert which I revoked. After doing that a new error came up. ("An App ID with Identifier '' is not available"... it also wasn't helpful) Eventually this lead me to the fact that my App Id in the member portal didn't have entitlements matching the build.
I solved this issue by editing the provisioning profile in the member center which is used in my app and re-install the provisioning profile.
I recently changed computer.
The reason for me was that I had several developer certificates in the Apple Developer member portal.
The solution was :
Go to Apple Developer Portal
Go Under Certificates -> Production
Click on "Revoke" for the oldest certificates and keep the most recent one
Revoking certificates won´t affect your Apple Store apps :).
I had this happen to me when I accidentally reset the certificate on another mac. Here's my scenario.
Mac1 - Had working certificate.
Mac2 - I accidentally reset the iOS distribution certificate
Mac1 stopped working and I get the message "Your account already has a valid distribution certificate"
The fix was
On Mac2, Keychain access -> certificates -> iOS Distribution certificate (for you/your company) -> export to p12 file (it will ask you to set a password)
Copy the exported file to Mac1
On Mac1, Keychain access -> certificates -> iOS Distribution certificate (for you/your company) -> delete (this is the old one that does not work)
On Mac1, double click the p12 file (then enter your password).
You should see a new iOS distribution certificate (for you/your company) in the certificate section of Keychain access.
This fixed the issue for me on Mac1.
Got it solved by deleting the provisioning profile which is managed by Xcode
(XC iOS Ad Hoc: *) from the member center

Error while uploading archive to iTunes Connect

'Your account already has a valid iOS distribution certificate'. I get this error every time I try to upload my archive. I don't have two dev accounts, nor did I use another mac before. Please help
This is a problem that appears after the updating to xCode 6. Just rename your provisioning profile in the developer portal, and then refresh the account info in xCode. Voila :-)
Your account already has a valid certificate
This dialog appears if the certificate already exists in Member Center.
Typically, this happens when you move from one Mac to another. If possible, export your certificates as a developer profile file on the other Mac, and then import them on your new Mac.
Have a look into Troubleshooting section of App Distribution Guide. It is described there how to solve this error.
I faced this error after Updating Xcode 6, to fix it
Revoke the IOS Distribution Certificate (from Member Centre ==> Certificates ==> Production).
Open Xcode project and re-login again to your account.
in the Account screen, click "View Details"
in the bottom left click the refresh button.
This will re-create the certificate automatically. and everything will work again.
In my case, the solution was to request a new dist cert, install it in my key chain, and also recreate the dist prov profile. Apparently, the cert I had in my keychain was old and was revoked and downloading the new cert from the dev center was not enough as it does not include private keys.

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.

Resources