iPhone provisioning profile problem - iphone

My iPhone application runs fine in the simulator. I'm trying to deploy it onto a physical iPhone. When I install the provisioning profile, my Organizer says "A signing identity matching this profile could not be found in your keychain."
I can't resolve this. What do I do?

A) Did you create a provisioning profile in the iPhone development portal?
B) If so, does the name in the info.plist file match the appID you created in the portal and used to create that development profile (that is, if you had created an app id of "com.fredsgreatstuff.*" in the info.plist you'd replace "com.mycompany" with "com.fredsgreatstuff")
C) Did you set PRODUCT_NAME in the project settings for all targets (to something like "mygreatapp")
From the look of the error though you must have got the development cert wrong, or not downloaded the certificate from the portal generated after you uploaded your developer signing request.
The portal has pretty good instructions at this point (that didn't used to be the case), be very careful to follow every step to the letter.

Make sure you've downloaded your certificate from the program portal. Double-click on it to create a private-public key pair in Keychain Access. The private key will be created when you download the cert and double-click on it.
If it does not, you might have to delete the certificate and create a new one. Make sure the in the certificate signing request you create, your name is exactly as you've mentioned in the portal.

Here is a really good website with a checklist on troubleshooting code signing errors:
http://www.drobnik.com/touch/2009/05/how-to-fix-code-signing-errors/
Most of its content is covered by the posts above, but it is easier to work through.
FTR, I hit the same problem that Genericrich pointed out - my Development Profile didn't have the private key, but my Distribution one did. As a workaround I just defined my Debug build to also use the Development Profile.

Make sure you have your developer certificate installed on the machine, AND that your private key installed with it. You can check this in the Keychain Access tool in your Utilities folder. The cert should expand to a private key icon with your name on it.

It might be that the "keychain" into which you installed your certificate is not currently set as your "default keychain". I had the same (or very similar problems) when my default keychain was somehow switched to a different default.
Open Keychain Access (Applications -> Utilities -> Keychain Access)
On the top left list box called "Keychains" make sure the keychain into which you installed your developer certificate (usually "login") is still bold (ie: set to the default keychain).
You can set the default keychain by right (or control) clicking on the keychain you want ("login" for example) and selecting the "Make Keychain 'xxx' Default".
Cheers.

I had the same problem with Xcode 4.0 on SL.
In the Organizer window, doing a "drag and drop" of the provisioning profile always gives a "Valid signing identity not found".
You have to use the + (add) icon and search for your provisioning profile file to upload it on your device. It just worked for me (no need to reinstall all the stuff).

Deleting all expired provisioning profiles in Xcode organizer did the trick for me. After this I clicked on the Refresh button in the organizer and the provisioning profiles have been downloaded automatically.

Related

Iphone Distribution error

I am new in iPhone Distribution . I created Apple ID U765UXW88D.com.edwincs.*. and
provisioning profile name is MobileHealthGuide. I made these in Distribution tab.
My xcode version is 3.2.4 While uploading application with application loader , I got this error
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate.
My project name is MobileHealthGuide too. I have tried revoking the certificate and provisioning profile, but the error persists.
How can I solve this problem?
I've encountered the same problem too. It showed that I had a duplicate certificate registration in my keychains. Removing one of them (I removed the one from my system keychain) fixed the problem.
Steps that helped me to resolve my problem:
Open KeyChain Access application
Select the 'login' keychain, and select in the bottom pane
'Certificates'
Switch to the 'system' keychain and see if there are certificates
registered in both chains.
Remove one of them
Rebuild the application
You probably need to check what code signing profile is selected in
your distribution build properties.
Alright, then make sure to clean the build & delete the Build folder from the app.
If this doesn't work for you, there is one more alternative :
Verify below steps to create distribution certificate and perform that if you miss anyone.
Generate a certificate signing request in keychain.
Using that create or revoke a DISTRIBUTION certificate in the
portal. after that download and install it and verify key under the
name.
Register the device in the provisioning portal.
Then create or modify a DISTRIBUTION profile in the portal. after
that download and install it and verify it appears to be valid in
Organiser as there are no warnings.
Make sure to select proper build setting in xcode.
Now this will definitely, solve your problem.
Make sure you added right code sign in project target.
Ok so here are detailed steps on how to distribute:
You want to request a development and distribution certificate in Keychain Access and upload it to developer.apple.com (you are part of the developer member program right?)
Create an app ID (in provisioning profiles)
Create a distribution certificate - make sure this and step 2 follow your bundle ID
Download the profile and drag to Xcode
Go to your Xcode project, in the target or project build settings set your code signing option to the Distribution certificate (which must match your Bundle ID and of course your distribution and development certificate) - there might be a recommended or automatic profile, just choose the one that matches your identity and app provisioning profile and Bundle ID
Now go to edit scheme -> then change from debug to release
Then go to project than target than build settings and type in 'Code Signing', change the options to your distribution profile
Set to build for an iOS device (or none at all)
Go to product -> Build For -> Build For Archive
Scroll down on the side (your classes tab etc.) to the product which should be named (AppName.app) and show it in finder.
Create an application on iTunes Connect
Compress the .app and load it to Application Loader
Send it off!
Tips:
Make sure you are using the correct Bundle ID
Try cleaning
Make sure you're certificate is not expired
Here is an expanded list of reasons why this may occur:
Upgrade your xCode! you are using a really old one.
Probably you tried it but go to https://developer.apple.com/ then iOS provisional portal there are lots of tools can help you.
If you are not using inApp purchase, push notification, iCloud etc. you can skip the App ID and just set a general certificate one that would be like U765UXW88D.* so that you don't need to do this process every time for new apps.
Make sure you created distribution certificate and sign with that on xCode for release/distribution.
On xCode itself make sure you defined the bundle ID same as on iTunes connect.
Good luck.
I've got a similar problem as well. In one project, using my dist profile, it works perfectly and I can build to a device.
In another project, when using the same dist profile, the app launches, loads the splash screen, processes the first page and then exits without throwing an error in Xcode or in its own log.
When I change the code signing to a generic dev profile, the app launches without a problem on the desired device.
I've redownloaded the certs, the dist profiles, deleted the old ones.
How is this even remotely possible? And how can this be fixed?
Failed signature verification can happen for many different reasons. See Apple's list of common causes in TN2250.
The most common reason for failing distribution signature validation is because the app was signed with a developer profile instead of a distribution profile, or the app was built with the wrong build configuration. To consider this potential cause check your settings against the recommendations that follow:
The Release build configuration must be assigned to your Archive task. To ensure this, select the "Scheme" pop-up menu in the upper-left corner of the Xcode Toolbar, and choose "Edit Scheme". Select the "Archive" task and make sure the Build Configuration is "Release".
To check that your app is signed with the correct distribution profile, use the steps in section How do I check which certificate was used to sign my app? and ensure the Authority is "iPhone Distribution". If it is not, continue to next bulleted items to correct the responsible configuration.
Ensure that the appropriate distribution provisioning profile that you created for this application on the iOS Portal site is assigned to the Release build configuration. To ensure that use the steps in section Assigning Provisioning Profiles to Build Configurations.
Next, ensure that you are choosing the correct distribution provisioning profile when distributing your app on the Xcode Organizer > Archives tab. To do that, use the sections linked below depending on your distribution method and take special note you're selecting the correct profile on the "Identity" field (Xcode 4-4.2) or "Code Signing Identity" field (Xcode 4.3+) after clicking Submit/Share/Validate or Distribute on the Xcode Organizer > Archives tab.
https://developer.apple.com/legacy/library/technotes/tn2250/_index.html#//apple_ref/doc/uid/DTS40009933-CH1-TNTAG32

Xcode 4 - "Valid signing identity not found" error on provisioning profiles on a new Macintosh install

I had a Macintosh I used to develop iPhone apps with using Xcode 4.
I now have a new Macintosh with a new install of... everything.
When opening Xcode projects built on the old Mac, I cannot run the app on the iPhone that was configured as a development iPhone.
Xcode 4 organizer tells me "Valid signing identity not found" on my provisioning profiles.
I guess this is something to do with the .certSigningRequest file I had generated before on the old Mac (I have a backup of that file), but what do I have to do with it on the new Mac?
Another strange thing, I don't see my 5 existing provisioning profiles (defined on Apple provisioning portal) in the organizer, even after a refresh and after having entered my provisioning portal login and password :
With Xcode 4.2 and later versions, including Xcode 4.6, there is a better way to migrate your entire developer profile to a new machine. On your existing machine, launch Xcode and do this:
Open the Organizer (Shift-Command-2).
Select the Devices tab.
Choose Developer Profile in the upper-left corner under LIBRARY, which may be under the heading library or under a heading called TEAMS.
Choose Export near the bottom left side of
the window. Xcode asks you to choose a file name and password.
Edit for Xcode 4.4:
With Xcode 4.4, at step 3 choose Provisioning Profiles under LIBRARY. Then select your provisioning profiles either with the mouse or Command-A.
Also, Apple is making improvements in the way they manage this aspect of Xcode, and some users have reported that the Refresh button in the lower-right corner does the trick. So try clicking Refresh first, and if that doesn't help, do the export/import sequence.
Picture for Xcode 4.6 added by WP
Edit for Xcode 5.0 or newer:
Open Xcode -> Preferences ('Command' + ',')
Select the Apple ID from the list.
Click on the SETTING icon near the bottom-left corner of window, and choose EXPORT ACCOUNTS... Xcode asks you to choose a file name and password.
On your new machine, launch Xcode and import the profile you exported above. Works like a charm.
Picture for Xcode 5.0 added by Ankur
I just run into the similar issue today. Unfortunately my HD died on me so I couldn't do the migration mentioned here in the accepted answer. I had to do the following steps:
Connect to the Apple Developer member center then the iOS
provisional portal.
Revoke my certificate.
Create a new certificate by providing a new pair of private and public key.
Remove all the previous provisioning profiles and create new ones.
Download the new provisioning profiles and install them in Xcode by just dragging
them to the Xcode icon in the dock.
The same action is also mentioned on this post.
Make sure your certificate is in the "login" keychain. Highlight the login keychain if you don't see it, search for it. Then drag the cert over the words "login". Close and re-open Xcode, ta-da.
You need to copy over the private key and certificate from your old Mac. Open Keychain Access on the old Mac and look in the Keys category of the login keychain: the key should be there. You need to export both the public and private key, then copy yourkey.pem and yourkey.p12 to the new Mac.
Importing them using Keychain Access will probably fail, at least under 10.6; you can use these commands instead:
security import yourkey.p12
security import yourkey.pem
For the error
Valid signing identity not found
see Apple's published steps to resolve this problem.
Regarding the issue of your "5 existing provisioning profiles" on the iOS Portal which are missing from your local library in Xcode 4.x Organizer > Devices tab > Provisioning Profile section under Library.
I recommend following the steps that walks you through restoring missing profiles and also covers the case of an Xcode bug in which Xcode 4.1-4.2.1 mistakenly deletes from your local library profiles which are "Active" on the iOS Portal.
You will have to go to your developer site, go to your certificates, and generate a new one for your current MAC and add it to your keychain.
And then you will need to add the Provisioning Profile again. It should work now. Basically you need to perform the same steps you did when you first got your Dev Certificate.
I had the same error but the issue was slightly different.
We have a team of developers but we all use the same Apple ID (Developer Account), so when I generated the Provisioning profile, I kept getting the same error as in the subject question. Then although I had downloaded the certificate (that gets prompted as part of the Development Provisioning Assistant steps), I was still getting that error. Then I found the issue was that our Apple Developer account was using a Certificate that was generated on my work mate machine, so I needed to revoke it, and generate a new certificate, then create the provisioning profile.
The Summary, the lesson learned is that the certificate that is used for your provisioning profile must be generated on the same computer where the provisioning profile will be used. This is especially important to consider when you have a team of developers sharing the same Apple ID.
Hope it helps somebody
My 2 cents on this error, even if not related to an export/import scenario:
when adding the mobile provisioning certificate (i.e. the PROV file), DO NOT drag the file from Finder to Keychain Access. Instead, just double click the PROV file within Finder, while keeping the Keychain Access application running somewhere.
I've actually seen my former provisioning item in Keychain (the one with yellow light) being substituted with a new, green one with same name and app ID. HTH
I faced this problem this morning when I just opened an old app with a different certificate and allowed its access to the keychain. My other app that was working pretty well, stopped working with this error. I've been pulling out my hair till now, when I simply did this:
Xcode Menu > Preferences > Accounts > THE_APPLE_ID_THAT_YOU_ARE_USING > View Details
In the new window, at the bottom left of the Signing identities press the + button and select iOS Development. It'll re-add the identity, and after that my problem is fixed now and the app is running on the device again.
My MAC OS Crashed recently. I reinstalled macOS 10.7.4 and Xcode 4.5. But all provisioning profiles were showing the following message in organizer.
Valid Signing identity not found
I struggled to find help for a couple of days. Later I realized that if you have migrated from one system to another(or formatted your system), you need to export your private key from your keychain from your old system to the new system (or new OS installed).
One can also export your developer profile/team developer profile in organizer.
Organizer > Teams > Developer Profile > Export
Hope it helps.
I had the same thing happen to me as Tiguero (thank you for your answer, it gave me hope), but here is a way to get rid of the "valid signing identity not found" error without having to delete all your provisioning profiles.
If you are on a new system and cannot retrieve your keys from another system, you do indeed have to delete and regenerate new Development and Distribution certificates for Xcode. You can do this via Xcode, or the old-fashioned way using Keychain Access.
Then what you can do is go into Provisioning, and in each tab, Development, and Distribution, click Edit next to the profile you want to update, and then Modify.
You will see a list of certificates, and you must check off the box next to the one you just made, then Submit.
Once you do this, go into your Xcode (I'm using 4.3.3)
Organizer > Devices > Library > Provisioning Profiles where you are getting the error message, and click Refresh. Once you answer the prompt to enter your developer login, Organizer will re-download the profiles, and the error message should go away.
I solved the "Valid signing identity not found" error with more or less:
Make sure that the certificate in your iOS developer program is also listed in your keychain access and is valid (compare the issue dates). If it is not, either transfer it from your old mac using the instructions from apple reference OR delete it from the website and your keychain access and then recreate it, re-download it and drag it over Xcode.
Delete any existing development or distribution provisioning profiles and recreate them based on your new certificate, redownload them and verify from keychain access that everything is valid.
It seems that you can transfer your Certificates and Provisioning profiles from one machine to the other, so if you are having issues in setting up your certificate and/or profiles because you migrated your Dev machine, have a look at this:
how to transfer xcode certificates between macs
The trick for me was discovering that even though I could see the developer cert under login, it was not under My Certificates. The fix was to export the cert from the keychain on the old mac, then import it into My Certificates/login on the new mac.
No one has mentioned this yet, and this may not be a common problem, but I had a similar problem with Xcode 5: Make sure you have a default keychain selected in the Mac's Keychain Access. I trying out a fresh install of Mountain Lion and deleted one keychain, which happened to be the default. After setting another keychain as the default (right-click on the keychain and select Make Keychain "Keychain_name" default"), Xcode was able to set up the valid signing identities.
I had this problem because the iOS Development Certificate associated with the provisioning profile was not in my keychain. I had reinstalled OSX and this was the result. I did the following:
developer.apple.com under Certificates, Identifiers & Profiles
select the corresponding (and valid) iOS Development Certificate, Download it
double click the downloaded file, it gets added to the keychain
errors in organizer go away
If you don't have a valid cert, generate a new one and make a new provisioning profile with it.

a valid signing identity not be found?

I am trying to create a distribution build with mono for days already... I got the distribution provisioning profile and the distribution certificate from our "team agent" and drag-dropped seperately onto xcode-organizer and keychain-access, but still, there's the warning message showing :
"A valid signing identity matching this profile could not be found in your keychain."
and I couldn't make the distribution build still. Any idea which step I made it wrong? Please advice; much appreciated!
Thanks,
ab.yyang
It sounds like you only have the provision file and the certificate from Apple, but not the original private key used to request the certificate.
If that's the case, you either have to ask whoever created it for a copy of private key, or you'll need to generate entirely new keys, request a new certificate and create a new provision file.
open Keychain Access
erase everything in 'Keys' and 'Certificates'
open Xcode and erase all provisioning data
goto Provisioning Portal and revoke your certificate
create a new one, and use launch assistant
If this happen after renewing the DEVELOPER CERTIFICATE,
my fix to the problem was going to the apple provision profile, modify the development provision and checkbox the certificate.(suppose to be empty checkbox near the certificate name).
then, you can : download and install the provision manually by dragging to xcode
or going to Organizer-Library(on the left)-Provision Profiles, and click the "refresh" button(in the bottom of screen), this will download the new provision profile that "connected" to the new CERTIFICATE and the warning will disappear.
If you are building to run on a physical device, you need to be enrolled in the iOS Developer Program. From there you go to the Developer Portal to generate a Provisioning Profile. That profile gets loaded to Xcode via the Organizer window.
Have you done those steps?

Multiple Certificates/Provisioning Profiles in one Xcode organizer?

There are several similar questions here, but none could answer my basic question:
Is it possible to have two separate developer certificates in the keychain and two corresponding distribution profiles in Organizer?
I have my own (working) developer certificate and provisioning profile for my own iPhone apps.
Now I finished a project for a client and would like to use his developer account/certificates/provisioning profiles to submit his app to the app store on his account.
Is that even possible?
So far I downloaded and installed his certificates and they show up in my keychain, and I installed his provisioning profile in Organizer, but Organizer tells me "A valid signing identity matching this profile could not be found in your keychain.".
Likewise, the archive build fails.
I couldn't find a way to tell Organizer to use the certificate of my client instead of my own-I think this is the problem.
Thanks for any help!
Yes I've produced app store builds of projects for clients several times using their distribution certificate. No need to use their developer certificate. There are many things can could go wrong here, if you have access to the client's account you can go on to the provisioning portal and check things out:
make sure the bundle ID in the project settings exactly matches the app ID on the iOS provisioning portal (com.company.appname usually)
make sure the app store distribution provisioning profile is marked as "valid" and shows up under the distribution certificate.
make sure the app store build config in xcode references the client's distribution cert.
open your keychain and make sure that the client distribution cert also has its accompanying private key. This may be the problem, it's the part usually left out. The client must export his private key for his dist cert and send it to you in the .p12 file along with the password to the .p12 file. The dist cert can't be used to sign the app without the private key!
sometimes just quitting Xcode and restarting it helps.
See this solution to duplicate certificates: http://tapadoo.com/2012/certificates-magically-re-appearing-in-your-keychain-try-this/
The gist is that if you have an old private key and provisioning profile around, you can run into a case where Xcode will re-create an old certificate in your keychain. This will make code signing gag because it requires a single certificate with a given name. Deleting the old private key will resolve this issue.
EASY MODE
(I hate these archaic export errors so bad. So many hours wasted. I'm not religious but I still pray this helps you)
Log into https://developer.apple.com
go to Certificates, Identifiers & Profiles
bottom left: Provisioning Profiles
Delete any duplicates / invalid profiles (in my case I only had one but it was invalid)
Note: if you're trying to export an archive, you can leave the export window open, delete a provisioning profile, then click "retry" or whatever the button says. This will save you from have to re-archive over and over
#xcode8.2.1 #osx10.11.6

iPhone Distribution: No profiles currently match

I am about to upload an app to iTunes Connect. I am not Team Agent, nor does it seem the Team Agent can make me a Team Agent. So he logged onto Member Center and downloaded a Distribution Certificate, which is in my Keychain along with the WWDR Certificate.
The bundle identifier is set to se."companyname"."appname".
When I set the Code signing identity to Distribution, it says no profiles match. Can only the Team Agent build the final apps for upload? How do I make XCode "use the right set of profiles"?
Any idea on how to get past this last hurdle? :)
Edit: can the Team Agent log onto Member Center and create a provisioning profile for the app, will that solve everything?
Answer: See Paul Peeleen's answer, I decided to add this additional information (too long for comment).
Paul, I'm going to mark yours as the correct answer, because it set me on the correct track... certificates are for the keychain (which is usually linked to a computer, or rather, a computer user's login, I guess).
A quite separate distribution profile must be created for the app - modifying an existing Development certificate to include the Team Agent only lets him develop. The little 'a-ha' or perhaps 'd'oh' moment was that it has to be created in the Provision section with Distribution tab selected (in the provisioning portal).
After that, in the Target Info/Build tab you just use the default automatic profile selector (dev/distro) and it's found automatically.
I also temporarily tried adding the 'gibberish' (f.ex. JX567ERNB.) before the se.companyname.appname for the Bundle Identifier, but the automatic profile selector told me that it shouldn't be there, I removed it and it worked!
The profiles are what enable the projects to use certificates in the Keychain, I guess.
"iPhone distribution no profiles match" is one of the most annoying issue that I have ever had with app development.
This is how I sorted it out:
In Developer under iOS Provisioning Portal I needed to generate 4 certificates and download the WWDR intermediate certificate to be able to submit my app to the App Store:
Under Developer Certificate section (link) generate a Developer Certificate. Also Make sure that you have the WWDR intermediate certificate installed, if in doubt download it from there.
Under Developer Certificate section (link) generate a Distribution Certificate (This is not that will show up in Xcode!)
Under Provisioning section (link) generate a Development Provisioning profile certificate
Under Provisioning section (link) generate a Distribution Provisioning profile. THIS WILL SHOW UP IN XCODE AS A DISTRIBUTION CERTIFICATE!
After that I was able to select the iPhone distribution profile generated at 4. Also make sure that your target settings are correct as they overwrite the project settings.
Your active provisioning profiles are listed under "Xcode/Organizer/Library/Provisioning Profiles"
I hope it helps
UPDATE: Some distribution provisioning profiles often just "disappear" from my list. So I have to download and install (just double click) them again from https://developer.apple.com/ios/manage/provisioningprofiles/viewDistributionProfiles.action not a big deal, but annoying.
I checked this with my accounts and it seems that only the team agent can create the stuff needed for AppStore or AdHoc releases.
IF you have the correct provisioning profile installed, and both your project settings and target setting for the "release" build are set to the correct provisioning profile. + that you have the correct certificates installed for that computer... you can build the release.
I am unsure if only the Team Agent can upload these build, but otherwise you can package the release as a zip file (which you should anyways) and send it off the the team agent. The Team agent can then use the Application Loader to upload the application.
Also dont forget If you deleted all your certificates and keys in Keychain and you plan on regenerating those certificates make sure you change your certificate preferences in Keychain for Online Certificate Status Protocol to Off and Certificate Revocation List to Off, for some resaon this important step is the only way it worked for me.
Another reason developer profiles are missing
While in organizer under Library > Provisioning Profiles...
On my computer, if I hit Refresh, all the Distribution profiles are removed!!!
No big deal, just go back to your provisioning portal and go to Provisioning > Distribution and download the appropriate distribution profiles and your good to go! :)
Instructions right from apple... Follow them EXACT
https://developer.apple.com/ios/manage/certificates/team/howto.action
To request an iOS Development Certificate, you first need to generate
a Certificate Signing Request (CSR) utilizing the Keychain Access
application in Mac OS X Leopard. The creation of a CSR will prompt
Keychain Access to simultaneously generate your public and private key
pair establishing your iOS Developer identity. Your private key is
stored in the login Keychain by default and can be viewed in the
Keychain Access application under the ‘Keys’ category. To generate a
CSR:
In your Applications folder, open the Utilities folder and launch
Keychain Access. In the Preferences menu, set Online Certificate
Status Protocol (OSCP) and Certificate Revocation List (CRL) to “Off”.
Choose Keychain Access -> Certificate Assistant -> Request a
Certificate from a Certificate Authority. Note: If you have a
noncompliant private key highlighted in the Keychain during this
process, the resulting Certificate Request will not be accepted by the
Provisioning Portal. Confirm that you are selecting “Request a
Certificate From a Certificate Authority...” and not selecting
“Request a Certificate From a Certificate Authority with …”
In the User Email Address field, enter your email address. Please
ensure that the email address entered matches the information that was
submitted when you registered as an iOS Developer. In the Common Name
field enter your name. Please ensure that the name entered matches the
information that was submitted when you registered as an iOS
Developer. No CA (Certificate Authority) Email Address is required.
The ‘Required’ message will be removed after completing the following
step. Select the ‘Saved to Disk’ radio button and if prompted, select
‘Let me specify key pair information’ and click ‘Continue’.
If ‘Let me specify key pair’ was selected, specify a file name and
click ‘Save’. In the following screen select ‘2048 bits’ for the Key
Size and ‘RSA’ for the Algorithm. Click ‘Continue’.
The Certificate Assistant will create a CSR file on your desktop.
I battled the problem all day too. Tried Tons of things.
I downloaded the distribution provisioning profile. OK
Double Click. Into Keychain it goes (like magic) OK
Build. NOPE. Not Signed
Check - it is not the Team Provisioning Cert that you are looking for it is the plain looking one that cannot be installed on devices.
If it is not there you did not copy it to YOUR library/MobileDevice/Provisioning Profiles folder. (just like I didn't)
Make sure that the case of your bundle identifier in the provisioning profile and your info.plist are the same.
I just had this problem, and resolved it finally when I saw that Xcode would not even let me manually select my distribution profile, saying 'profile doesn't match bundle identifier myappname'
When a took a close look, I saw that the bundle name had the app name capitalized, and the provisioning profile had the appname in all lowercase.