'Valid Signing Identity Not Found' in Xcode 4.2 - xcode

I know there are other questions that are very similar to this, but their symptoms aren't quite the same as mine.
I have an app that I've been trying to submit to the App Store. I was running Xcode 3.2.6, and I kept getting an Invalid Binary error from iTunes Connect. I eventually found an answer that points to upgrading Xcode, so I downloaded 4.2.
Now the problem is that Xcode won't recognize the distribution certificate that I used for the provisioning profile. I tried adding the profile and it gives the error message in the title. Also, if I try the Automatic Device Provisioning, the Distribution profile disappears completely.
This has been causing me some trouble for quite some time now. I know I have the Distribution certificate in my Keychain, so I think that Xcode is having a hard time seeing it for some strange reason. If you have an answer, please give it. If you need more info, go ahead and ask. I just need to find a solution...
EDIT:
I'm thinking of diving into the project file through text edit and manually adding the distribution profile. At the part that says PROVISIONING_PROFILE = "", what do I put between the quotation marks?

It sounds like you might not have the private key that you used to generate the certificate with Apple originally. If you have the private key installed when you open keychain access and click on certificates there would be a disclosure triangle you should be able to drop down and see the private key for that certificate like so:
If you don't have this key you need to delete the certificate you currently have, go to the iOS provisioning portal, revoke your current certificate and create a new one. The whole process shouldn't take more than 10 minutes.

Related

How do I fix "Missing Private Key" for xcode apple provisioning?

On a new mac, I installed xcode and needed to set up provisioning for a hello-world project to deploy to my iPad.
NOTE: I am using the new FREE provisioning (do not have a paid Apple account)
I went to Preferences/Account signed in to my Apple account
In the project, General tab, Team is set to my (free) Apple Dev account. (all seemed well, it recognized this as valid)
I tried to deploy to the iPad and I got a build error "codesign failed with exit code 1"
Supposedly this is to do with certificates. I went to Keychain Access and found "iPhone Developer: my#email.com (...)" in there, which was added when I signed in via my Apple Account.
I DELETED this key (thinking I would simply re-add my Apple Account and thus this key)
I then removed and re-added my Apple account from xcode preferences
I can sign-in, I can see it adds keys, and Keychain Access Get Info on the keys indicates no issues (valid, etc)
In xcode Preferences, when I click Manage Certificates, it shows "David's MacBook Pro (2)" and a bunch of "Untitled" keys ALL of which have a status of "Missing Private Key".
xcode/General/Status section says "The username or passphrase you entered is not correct" even though my "Team" is signed in and valid
Clicking "Try Again" shows "Waiting to repair", followed by "revoking...", followed by "Generating certificates" - which sounds promising, like it's doing exactly what I need, but then fails, private keys still missing, and back to step 9 here in a loop of hell.
ok? How do I get this resolved without flattening my OS back to factory and starting completely over?
Note: there are resolutions on SO that talk about Revoking the keys and generating new private keys from the Dev Console, like this one:
How can I add private key to the distribution certificate?
HOWEVER, on a "free" account I have NO access to the Certificates section! I can't manage anything from the Dev portal online. I do, however, see xcode specifically set up to handle certs (see step 9-10 above) but it is not working. I really don't know where to go from here. I'm new to all things Mac and iOS and xcode. Frustrated. Thanks Apple, so much for a simple on-boarding experience on a simple hello-world app.
After two bounties for this question which gave no results, I managed to find a solution to this problem.
Apparently, it was some keychain related problem.
To fix it:
Open Keychain Access on your Mac.
Right click on the "login" keychain in the left side of the window.
Press Lock keychain "login".
Then do the same to Unlock it.
Go back to Xcode and try to set your app to run with your personal account.
Solution was found using the first comment here:
https://github.com/desktop/desktop/issues/3625
I had this error and it occurred because I had moved to a new Macbook. Although there was a provisioning profile on our Apple account and it was not expired, the private key was on the old Macbook. So downloading and installing the profile did not help, as it was the private key that was missing. I revoked the provisioning profile and created a new one. I had the same issue for the distribution certificate.
If you are concerned whether revoking and creating new certificates/profiles will affect existing deployed applications, take a look at this question and the answers. The bottom line is, for applications on the app store it will have no affect, but for Enterprise Distributions, deployed applications will stop working if you revoke the provisioning profile. So if the application is on an Enterprise Account, then it is best to try find the private key in the keychain of the Macbook where it was created.

Missing Developer ID Application signing identity for (null)

While trying to export a Developer ID Signed Mac application with Xcode I run into this error: "Missing Developer ID Application signing identity for (null)" How do I resolve this?
I struggled with this issue for a while so wanted to post what I found in case others run into a similar issue. I ran into the above issue after revoking my certificate while trying to export my build from a friend's machine. I found the best support by going step by step through this link:
https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/DistributingApplicationsOutside/DistributingApplicationsOutside.html
I would recommend following the steps in this link for anyone uploading a build to the Mac app store or exporting a Developer ID Signed Mac application.
There is a certificate called "Developer ID Certification Authority", this seems to be the one I was missing, and which caused the most trouble.
Another interesting thing to note is that the 10 digit letter/number ID for your Team/Distribution profile will be different than the ID for your developer profile. This should not throw you off, these two profiles work together.
Another good thing to know is that at the top of developer.apple.com there is a non-obvious drop down menu that lets you switch between iOS, tvOS, watchOS profiles and MacOS X profiles.
Another non-obvious UX issue when dealing with certificates is the system tab within Keychain Access. If you read that you should delete or change a property both within Login and within system, when they write system, they are referring to the system tab, which can be accessed within Key Chain access and can be seen at the bottom of this image:
This link is also helpful for certificate trouble shooting:
https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/Troubleshooting/Troubleshooting.html#//apple_ref/doc/uid/TP40012582-CH5-SW11
But mainly just go through the steps in the first link given for exporting a Mac App with Developer ID Signing.

iTunes Connect and Xcode 8: your app has changed to invalid binary

Last week, with Xcode 7, I was able to upload without any issue. But today I am getting the message your app has changed to invalid binary.
I have seen that now with Xcode 8 a new icon 20x20 2x and 3x is added. I added one, but still getting the error.
Does anyone had similar problem?
Сheck your email!
In my case, I wasted a lot of time because I did not check my email. When you get such an error, Apple sends you an email with it's description.
For example, this is what Apple sent me:
"This app attempts to access privacy-sensitive data without a usage
description. The app's Info.plist must contain an
NSCameraUsageDescription key with a string value explaining to the
user how the app uses this data."
After days of wrestling with the same problem I finally got my app successfully submitted, but only after being on the phone with Apple Developer support.
A couple of things to keep in mind:
Make sure you set the Info.plist description keys for any entitlements. This is necessary for iOS apps. Mine was a macOS app, so this didn't apply.
Head over to iTunes Connect, and recreate all your provisioning profiles and code signing certificates if you're not 100% sure that they're valid. You can do it for both Developer and Distribution.
In Xcode, turn off automatic code signing for your app, and any build targets (you can try automatic code signing in Xcode after completing steps #2 and #4 but that wasn't what worked for me).
Go to Xcode preferences, and click your development team, and in the sheet that comes up, you should see some "Download" buttons beside the newly created (in iTunes Connect) code signing certificates and provisioning profiles. Click them all. And so you don't get confused in step #5, delete all the other stale provisioning profiles and code signing identities for this app.
In Build Settings for each of your targets, make sure that the Release build setting for code signing, and provision profile are set to the above newly created code signing certificate and provisioning profile.
Bump your build number.
Deep clean your project (Option-Shift-Command-K).
Archive build your app.
In the Organizer that opens up, select the newly archived app, and validate (it always validated, but I still would get Invalid Binary later).
Export the build and select the option "Save for Mac App Store Deployment" or similar.
When prompted, use the same Provisioning Profiles you used previously and save.
Open the .pkg in Application Loader which you can launch from Xcode > Open Developer Tool > Application Loader menu.
I was't getting any emails on the Invalid Binary issue. Instead, I was lucky enough to have set up my iPad with iTunes Connect, and so, like clock-work, I was getting notifications within a couple minutes of uploading the app: "Your app ... has changed to Invalid Binary."
If you don't get one of these Invalid Binary notifications, that's a good sign. Another 10-15 minutes later, I checked the iTunes Connect portal, and I could finally add the uploaded build and submit for review.
After a while of searching, as a last-ditch effort I added every possible 'NS...UsageDescription into each of my target's Info.plist and this seems to have worked. After process of elimination, I deduced that it was either the NSAppleMusicUsageDescription or the NSFaceIDUsageDescription key-string pair that was preventing the upload from being successful so I just added them even though I don't use either in my project. I have also read on some other threads that something with a new version of Xcode required them to have the NSAppleMusicUsageDescription even though they didn't use anything related to Apple Music.

xcode organizer refreshing provisioning profiles

I have had a look around and everyone seems to be having loads of different issues with the xcode organizer, but they don't seem to be having the same issue so I can't quite isolate my issue.
The issue I am having is when I go to the organizer and refresh the provisioning profiles it produces a message saying
Sign in with your Apple ID
the username and password I provide are both correct but the window goes away and then immediately returns and doesn't say whether or not I enter correct details (I know they are correct) and it will continue asking me this for as long as it takes to refresh the profiles. This also happens when I select a device to use for development, but the device is never actually added to the team provisioning profile even though it says it has been.
Has anyone any idea how I can stop this?
I guess in your position I would carry out the following checks:
Can you log in to your account on the Provisioning Profile. If
you can then your Apple ID and password must be OK
When in Xcode and responding to the 'sign in' message are you
using the username & password remembered by KeyChain? Are you sure
these are both OK? Maybe enter them manually again to make sure
In Xcode go to the Provisioning Profiles screen in the Organiser
tab and right-click a profile and select 'reveal in Finder'. Does
the folder holding your local copies of provisioning profiles
contain any extra files that might be old/corrupted versions? If so,
delete them, return to Xcode and attempt to refresh again.
If the above three checks don't yield anything useful then I
think it must be something corrupted on the provisioning profile
(such as a provisioning profile or certificate) that needs to be
revoked - letting Xcode create it/them anew for you. Or something
out-of-date or corrupted locally (maybe a public or private key or
certificate in KeychainAccess - a local copy of a provisioning
profile). And you may have to start revoking/deleting digital assets
to get things working again (but only do this if you have no other
choices...)
I once had a horrible issue with an iPhone developer certificate that took ages to fix - but perseverance eventually paid off - good luck!

no valid keychain for xcode

after 6 month of break I try to finish my first app.
After I downloaded the new XCode and the new SDK (I needed it, because old XCode and SDK was 4.3, my iPhone was on 5.0.1) I try to build, but it told me my signiture was to old.
So I cleared all things I have found in my keychain: certificates, keys and so on.
I remember that it is a really really mess, but I tried the last 5 hours withour writing a single line of code...
At the moment I created a new certificate in the Apple Online Portal.
I downloaded and double click it, so it's in the Organizer now.
The error from XCode when try to start on my device is now:
There are no valid certificate/private key pairs in the default keychain
Can someone help me? (Skype would be nice), I am really lost in this after 5 ours of triend all I found on google and get very very lost.
When you are installing certificates first time you will have to install "Apple Worldwide Developer Relations Certification Authority".
Check whether it is available in the system tab of keychain access.
If you double click the certificate and provide password, it may be possible that it gets added to system tab. So make sure it is added to the login tab.You can just drag and drop the certificate from system to login.
In xcode organiser window you should see the provisioning profiles. If you don't see your profile there install the profile double clicking it. Also check profiles' expiry date.!
Hope this Helps!

Resources