iPhone Developer Portal won't accept my CSR - iphone

I am using the Development Provisioning Assistant in the iPhone Developer Portal, but when I get to the part where it asks me to generate and upload my CSR, I try to upload it and it just gives me this error:
The CSR selected is invalid. Please check the file and try again.
Does anyone know what this means or what I can do about it?? Thanks!

Also make sure you use Safari for uploading.
I tried Chrome and it always failed. Then I switched to Safari and it worked with the same CSR.

Never mind, I figured it out... in case anyone else has the same problem, I fixed it by downloading the WWDR Intermediate Certificate before generating the CSR, which I forgot to do. slaps forehead

If you do not have the following menu item: "Keychain Access->Certificate Assistant->Request a Certificate from a Certificate Authority", then you need a new WWDR Intermediate Certificate. My menu item was originally similar, but had some extra text in the title. Downloading and installing a new certificate changed the menu item and allowed generation of a valid CSR. This was odd because my previous WWDR Intermediate Certificate appeared in my keychain as an unexpired certificate.
I logged a bug at bugreport.apple.com asking for a clearer error message and pointing back to this SO discussion. Edit: fyi.. apparently developer portal bugs should be logged by sending email to devprograms#apple.com instead of the "product" targeted bugreport website. I encourage folks that have wasted time on this issue to provide helpful feedback regarding the issue via email.

If you are not able to upload the CSR using launching assistant, try going to "Provisioning Portal -> Certificates". Upload your file there and click "submit" button at the bottom.
I had my certificate this way.

I had the same problem, and what fixed it for me was to repair my login keychain. Go to 'Keychain First Aid' in Keychain Access and you can verify/repair your config.

Second on the Chrome vs. Safari conflict and solution.
The instructions on the iOS Provisioning Portal -> Certificates -> "How-To" tab are exactly correct, but I have a repeatable failure on upload in Chrome, and instant success on Safari.
Versions:
OS: OS X Snow Leopard 10.6.6 64-bit
Chrome: 8.0.552.237
Safari: 5.0.3 (6533.19.4)

Did right the opposite: used Firefox instead of Safari and the button worked.

I had a similar problem.
When creating a CSR for enabling push notifications, I first had to deselect the current selected key in Keychain Access before selecting Request a Certificate from a Certificate Authority. That solved my problem
Make sure you have only "Request a Certificate from a Certificate Authority" and not something like "Request a Certificate from a Certificate Authority with key "

If under Keychain Access you only have the option for "Request a Certificate from a Certificate Authority with key" it will not work. This indicates you have not downloaded the "WWDR intermediate certificate". You can get it from the "Certificates" tab in the iPhone Provisioning Portal. Once its installed (double click it to install), the menu item will change to "Request a Certificate from a Certificate Authority" and it should work.

Related

Valid Signing identity Not Found in Xcode

Actually i developed an app using my own developer certificates and provisioning profile.
Now i need to publish it on my client developer account and my client sent his distribution certificate along with provisioning .And I have installed the certificate and then i drag the provisioning profile to xcode, and i have got error message like "Valid signing identity not found"
Please assits me.
Change code sign in project settings.
You need the private keys that were used to sign the certificate. If you don't have them
anymore you can generate a new signing request.
You need p12 file from your client to use its developer certificate and provisioning profile.When your client provide you that p12 file than double click that file and its run perfectly.
And for geting p12 file ,select the cert, and open the arrow to also select the private key and export them together as a .p12 file from Keychain Access.
There are several ways to solve this issue.
The first one is, to export your developer certificate including the associated key from your keychain and importing it on your client machine.
The other way would be (If your client machine would use another apple dev account) to go through those steps listed here Apple Certification & Provisioning
I would recommend to delete the old certificates from xcode, sometimes xcode might lag otherwise

Provisioning Profile Issue

My Apple Certificate had expired. So i went in the Developer's Provisioning Area and Revoked My certificate. I deleted my old certificate, and old provisioning profiles.
Upon notification from my Team Lead. I downloaded the new Developer Certificate to my Mac and Dragged it into KeyChain Access. Now it shows my certificate as valid. I re-downloaded the provisioning profile for my App. and Dragged it into XCode4. The Organizer shows it to be valid but with a warning
XCode Could not find a valid private key/certificate pair for this profile in the keychain.
Have i done something wrong in my approach.
I am able to run my app on the iPAD and debug it too. But i somehow sense an issue in the above statement.
Please Help.
If you didn't recreate the provisioning profile with the new developer certificate (i.e. if you downloaded the old profile) then I think this is the problem - you will need to create a new profile with your new certificate.
You did to get the certificate key/pair from your team leader. Apple does this weird thing where it actually signs it's certificate with a "password" in order to use the certificate you have to have the "password". That's why you get XCode Could not find a valid private key/certificate pair for this profile in the keychain. I had the same thing, you can't just download the new certificate :(. If I can find the documentation of Apple that says how to do this I will post it in an edit.
Ok here is the docs: https://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/10-Configuring_Development_and_Distribution_Assets/identities_and_devices.html#//apple_ref/doc/uid/TP40007959-CH4-SW2
It is under "Provisioning a Device for Development", I Hope this helps!

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?

Getting the app onto the phone... certificate signing and identities

The error I received on build attempt was:
Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain
Anyone know how to resolve this?
Thanks // :)
Are you a paid up developer ?
Have you created a provisioning profile for your application ?
Have you installed a provisioning profile via the Organizer?
if you have, then you need to go to the KeyChain utility, ensure that Login is the default Keychain, and that iPhone Developer:yournamehere certificate is installed along with the public and private keys of your dev certificate.
if you haven't, then you need to follow the steps in the provisioning utility http://developer.apple.com/iphone/manage/overview/index.action
This took me about 3 hours to figure out but I found that when you send the request for the certificate, if you have multiple profiles on your computer you might have to request it from your name from the keys in KeyChain Access... just doing it from the drop down menu wasn't binding the certificate to the private key...
Sounds stupid simple, but it worked for me:
Restart your Mac
I know, what is this, Windows? But really, I just upgraded xcode 3.2.5 with ios 4.2 and same problem running new xcode. After banging my head around a bit, just restarted my Mac, came back into xcode, and bingo!
Hope its that easy for everyone ;)

/usr/bin/codesign failed with exit code 1

I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
/usr/bin/codesign failed with exit code 1
Anyone have any ideas why this is happening?
Update:
The Technical Note in my original answer is now deprecated. Apple posted a collection of code signing problems (and some solutions) in a new document: Technical Note TN2407 Code Signing Troubleshooting Index
Check the CODE_SIGN_IDENTITY property in your build settings. Is your provisioning profile selected there?
You also need to enter a valid bundle identifier in your apps .plist.
The identifier has to match the one you provided when generating the profile.
Apple has a technote about that here.
I just came across this error, and here's what I found out in case this helps anyone: I discovered that you can right click the error message in Xcode and choose expand to get more details, including a description of the problem.
In my case, I had two copies of my developer certificate with the same name in different keychain files, and Xcode couldn't figure out which one to use.
It might be strange answer for codesign issue in Xcode 9.0. I was receiving this error too and did not know what to be done, because everything was correct.
I went to the keychain, I had the login option "unlocked". I locked it and compiled my build again. Xcode itself asked me to open access keychain. I gave access and it worked.
Steps were:
Go to keychain
Lock it
Archive the code, build the project again
I had the exact same error, and tried everything under the sun, including what was elsewhere on this page, with no success. What the problem was for me was that in Keychain Access, the actual Apple WWDR certificate was marked as "Always Trust". It needed to be "System Defaults". That goes for your Development and Distribution certificates, too. If any of them are incorrectly set to "Always Trust", that can apparently cause this problem.
So, in Keychain Access, click on the Apple Worldwide Developer Relations Certificate Authority certificate, select Get Info. Then, expand the Trust settings, and for the combo box for "When using this certificate:", choose "System Defaults".
Others have commented that you may have to do this in System and login keychains for these errors.
There could be a lot of reason when you get this kind of error:
Check whether you have selected a provisioning profile which includes the valid Code Signing Identity and a valid Bundle Identifier in Settings. (Goto Build Settings->Signing->Provisioning Profile).
Open Keychain Access and click on lock icon at top left, so it will lock the login keychain and then again click to unlock.
Goto File->Project Settings->Derived Data and delete your project build folder. After that clean and build your app.
I had the same problem the distribution build. It just happened all of sudden. In fact I did not have this problem a few days ago and I had my Ad-Hoc version compile right. This issue came up because my certificate just expired today. So I went create a new provisional following Apple's guidance: (http://developer.apple.com/ios/manage/distribution/index.action).
After spending hours on the net and made sure I had not fallen for what could go wrong. Here is what save me as suggested by Tobias and Dan Ray:
"...discovered that you can right click the error message in Xcode to view details".
"...the issue was an expired certificate on my System keychain. Keychain Access doesn't, by default, show expired certs".
The detailed information told me about ambiguous matching two certificates. One of them happened to be an expired certificate in the System key chain. So I deleted the expired one then it worked! I also had a concern about what to enter in the "common name" when create the distribution certificate using the keychain utility: my name or my company name. In my case, I entered my name. I am guessing it is the same as the title that addressed by the developer's auto responder email.
Great help. Thanks.
If the error immediately preceding the codesign error says something like 'resource fork, Finder information, or similar detritus not allowed'
Then navigate to the .app file in Terminal and type:
xattr -cr < path_to_app_bundle >
ref: https://developer.apple.com/library/content/qa/qa1940/_index.html
What worked for me was adding --deep to Other Code Signing Flags in Build Settings.
More information here: Codesign of Dropbox API fails in Xcode 4.6.3: "code object is not signed at all"
Unfortunate that this ambiguous error condition has 400 different solutions, but I digress.
I had the same problem. In the end it turned out that my private key did not allow codesign to access it. One can see this in the info dialog in keychain application.
I have to agree with Tobias. The error is too generic. When the same thing happened to me I dug into the error message and realized I'd screwed up something in the build properties, but not the code signing. So yeah, I'd dig in to the details.
In my case error was due to the fact that I had two keys on the keychain with the same name. I deleted the old one and that solved the issue.
Going to the detail message show the real problem to me.
after hours of googling and trying out different things, this is what fixed it for me:
Make sure there are no certificates in the System > Certificates tab on Keychain Access. Remove all duplicate certificates from there.
Install the WWDR intermediate certificate under certificates from the provisioning portal, in addition to the developers certificates and make sure you see it in the Login > Certificates tab on Keychain Access.
hope this helps some of you!
Same issue with ambiguous (matches "iPhone Developer: [me] " and /// tweetdeck's library privatedata file. Fixed it by moving file to the trash and re-logging into Tweetdeck, setting up passwords again. What a pain.
I had the same problem but also listed in the error log was this: CSSMERR_TP_CERT_NOT_VALID_YET
Looking at the certificate in KeyChain showed a similar message. The problem was due to my Mac's system clock being set incorrectly. As soon as I set the correct region/time, the certificate was marked as valid and I could build and run my app on the iPhone
I was also getting this error ("/usr/bin/codesign failed with exit code 1"), and when I looked in Keychain Access my developer certificates were marked as "This certificate was signed by an unknown authority". I had recently upgraded to Mac OS 10.8 and have had a couple of other XCode (4.5.2) issues since then. It turns out I did not have the WWDR intermediate certificate installed. I downloaded that from the iOS Provisioning Portal, installed that in Keychain Access, and my project builds again!
When I got this error I wasn't even trying to sign the app. I was writing a test app and didn't care about signing.
In order to get rid of this message I had to select "Don't Code Sign" from Build Settings under Code Signing.
Sometimes your build folder simply needs cleaning - it certainly worked for me. Thanks to loafer-project for the solution.
One possible cause is that you doesn't have permission to write on the build directory.
Solution: Delete all build directory on your project folder and rebuild your application.
I just came across this error and it was because I was trying to write the build file to a network drive that was not working. Tried again from my desktop and it worked just fine. (You may have to "Clean" the build after you move it. Just choose "Clean all Targets" from the "Build" drop-down menu).
Tobias is correct though, dig into the details on the code by right-clicking it to see what your specific problem is.
One thing that you'll want to watch out for (it's a stupid mistake on my part, but it happens), is that the email address attached to the CSR needs to be the same as the email connected to your Apple Dev account. Once I used a new CSR and rebuilt all the certs and provisioning profiles, all was well in applesville.
Another reason,
Check your Developer account is connected with xCode
Kinda old question, but still happens it seems. Another solution:
Occurred for me after reverting a branch in git.
Tried cleaning, cleaning builds, deleting derived and restarting Xcode, but no luck.
Try rebooting the comp.
I had the same unknown error from codesigning that you mentioned. Similar to the answer provided (but a little different), I just locked my keychain access and unlocked it, and I was able to build and run to my device again. If anyone has the same issue, perhaps try that first before going through the trouble of modifying the keychain password.
Throwing my comments into the ring, I just came across this after attempting to refresh my development environment after clicking DENY accidentally on one of the application requests, after searching around I found a number of things that didn't seem to work. This is the full order in which I've attempted the fixes and whether there was a success:
1) Attempted to clear the DerivedFiles and restart XCode - no dice
2) Attempted to Log and Unlock the Keychain, then restart XCode - no dice
3) Attempted to refresh my developer account within XCode - no dice
4) Bit the bullet and just reset my entire keychain, after doing so my developer account was signed out (signed back in), then restarted XCode - no dice
5) Found an article on here that said that we needed to set the [login|local|System]/certificate/Apple Worldwide Developer Relations Certificate Authority to "System default". But in my case it was already set to system default - no dice
6) Then I looked at my actual developer certificate login/my certificates/Mac Developer: and when I looked in there it was correctly set to Confirm before allowing access BUT there was no entries in the lower section. There should be [Xcode, codesign, productbuild]. I deleted the certificate entry and restarted XCode - bingo
The certificate was added and I was then prompted. So what did I do, I pressed "always allow" and then just boned myself.
I had to go back and delete the certificate again, then go through about 20 allow dialogs during a clean build. Once completed, I was able to build completely.
In My Case, after a fews days of research,
All I did to revolve is listed below:
delete all the certificate on your keychain.
goto your apple account. a) download the specify certificate your want to install on your keychain. b)(Optional) Also create and download the require profile.
in Xcode, clean your project. This may take some time.
Build your project.
This should work for similar codesign issues.
Note, during this process the OS would ask for your credential validation.
I use Xamarin and for me this is what worked after trying everything else.
In Visual Studio for Mac I've opened a .xib file so it opens the project in Xcode.
Went to the project settings > Signing and Capabilities, selected the team and then fixed the Signing Certificate.
I think the issue is with the Keychain Access and certificate trust.
Try adding the following certificate Apple Worldwide Developer Relations Certification Authority from https://www.apple.com/certificateauthority/ (Expiry validity 2030)
The trust warning indicated in certificate will be fixed and then try building the iOS application again
Open the project path in terminal and enter the below commands in terminal
1) find . | xargs -0 xattr -c
2) xattr -rc .
This works for me.