xcode organizer refreshing provisioning profiles - xcode

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!

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.

How do I regenerate Xcode managed provisioning profiles?

I see a bunch of "Invalid (Managed by Xcode)" development provisioning profiles in the Apple Developer Center.
How do I regenerate them so they become green? (i.e. "Active (Managed by Xcode)")
When I try tapping on an active one, I have the following options:
Delete
Download
When I try tapping on an invalid one, I have the following options:
Delete
I don't know exactly what forces a refresh, but in the past, these things seemed to help:
Deleting all provisioning profiles in Xcode and pressing the Download All button regenerated the profiles (e.g. As a member, I pressed the Create button to create the development certificate, then pressing the Download All button added the newly created certificate to the managed profile.)
Adding a new device via the online portal seemed to regenerate the managed profiles to include the newly added device.
Pressing the Fix Issue button in Xcode in the target settings.
Try building to device and press the Fix Issue button when Xcode presents that option.
Sometimes you'll get in a state where everything gets regenerated except for the one with the app id you really need. The provisioning profile doesn't show up in Xcode, and no matter what you do, it stays stuck in the invalid state.
WARNING: The following may be very hard to undo, so do so at your own risk!
In that case, you could try deleting the provisioning profile on the Apple Developer Center and hope that the Fix Issue button in Xcode will regenerate it. I've seen it work before, but in some cases, I've seen it give this error with no means of recovery:
An App ID with Identifier 'com.example' is not available. Please enter a different string.
This may seem like you're in an even more unrecoverable situation, but I was able to regenerate it at least once by launching Xcode Beta 8 and tapping the Fix Issue button. It seems that they fixed some bugs with the Fix Issue button in the latest Xcode.
(Note: Sure you could try to delete the offending App ID and then press the Fix Issue button, but you'll invalidate all the important provisioning profiles on your account.)
If you still run in to issues, make sure that you're following these best practices.
If you run into code signing issues:
Make sure the development certificate has been downloaded.
Delete all invalid certificates from KeyChain.
Delete all provisioning profiles from your machine.
Download All the latest profiles.

App profile needs to be renewed?

I just clicked on Organiser in XCode (I'm running latest publicly available version), and I noticed on one of my apps profiles it says "renew" so I click on that and I get an error msg, saying..
The given profile was not found on the provisioning portal.
Please refresh your provisioning profiles before attempting to renew
“AppProfile"
I don't understand any of that. So...
1) What is it asking me to renew? a development profile? do I need to renew developer profiles? what happens if I don't?
2) Why am I getting an error? what does it mean by "refresh my provisioning profiles" ?
3) Do I have to do this (whatever this is and however I have to fix it) for all profiles? development and distribution?
well i dont know if you have found an answer or not but here is my answer.
you need a valid developer and also distribution profile ( i am sure you are aware of this already) to upload your app. if your app is uploaded and is in the app store you still have maintain a valid developer profile in order for your app to stay in the app store. otherwise they will bring it down.
the fact that it asks you to refresh your developer profile is related to the new system of developer profiles that all of a sudden got introduced. there is no need of renewing your profiles every 3 months anymore. your profiles are good for a year. you have to go to organizer in xcode and select all the profiles you have in there. delete them and then go to your team or your own name on the right pane and there you find the refresh button down at the bottom of the window. when you use that it resyncs your profiles with the developer site.
yes you may have to do that for all of your profiles if you have not done that in past three months.
i hope you find my answer useful.
Edit:
Just go to the developers site and revoke the ones that are about to expire or already expired. Then remove them from keychain and xcode also. Then in keychain create a new certificate request and on the Dev site create new profiles. After creating the new ones download them so they can synch with keychain. After that go the organizer and refresh. Xcode will synch with developer site and will download the new ones. Make sure you connect your test devices so the new profiles can be updated as well. That should do the trick.

"A valid provisioning profile matching the application's Identifier '' could not be found" error

I am working on an app that I would like to put onto some iPads (not the App Store). I bought the developer license, and added the provisions on Xcode. Now when I try to build the app for the iPad which I have connected to my computer, I get the error:
A valid provisioning profile matching the application's Identifier '' could not be found
I think that this problem has been caused because I have two different teams running on my Xcode, and I don't know how to specify the correct one (one has expired). Also, I remember when I first created my App that I didn't really pay attention to the fields like 'Company Name', can I change those now?
EDIT: Here are the provisions I do have:
I had the same issue when i first installed the provisioning profile on the XCode. i'm using Xcode 4.5.* version. Although I installed the prov profile and certs in my mac, when i go to the Devices tab in the organizer in Xcode and clicked my device, i still couldn't see the new provisioning profile was added to the device. So I clicked the "Add to Portal" button with a + mark on it. It did the trick and i was able to test my app successfully without any errors about missing prov profile. Hope this helps for some of you with the issue i had.
This is a very common (to me at least) error. It sounds like you just don't have a mobile provision for the app you're trying to put on your iPad. You need a .mobileprovision file for each app identifier. As for the various names of things, you can edit them in the info tab of your project or in info.plist.
If one of your profiles has expired then delete it, although this shouldn't affect anything.
To get a provision for your app, go to the apple provisioning portal and add a provisioning profile. Then you just have to put all of the specifications (UDID, development cert, application ID) in and it'll kick out a provision. There's a how-to guide on the apple developer site for both making provisions and putting them where they're supposed to be.
For some reason it also looks like your app's identifier is empty; you can change this in your project's info tab. The .mobileprovision app ID and your app's ID have to match EXACTLY otherwise nothing works.
In my case, I had to first BUILD the app with Cmd-B.
This popped up a keychain window access asking me to "Allow" (or "Always Allow") Xcode to access the keychain.
Only THEN could I actually run the program to launch it on my iPhone.
Apparently, hitting only run didn't do the trick.
(Btw, remember to first sign your app with the "iPhone Developer: Your Name ()" key.
As Dustin said:
The .mobileprovision app ID and your app's ID have to match EXACTLY
otherwise nothing works.
In your info.plist XCode automatically sets the 'Bundle identifier' to something like:
com.domainname.applicationname${PRODUCT_NAME:rfc1034identifier}
Delete the '${PRODUCT_NAME:rfc1034identifier}' and leave only 'com.domainname.applicationname' so that it exactly matches your provisioning profile ID.
This worked for me when I had the same issue. Hope it helps.
This progress is a chaos. the hardest issue in the universe and the world I think.
it should be simple.
in xcode5 "fix issues" button doesn't fix issues. but hey ! this isnt take a day. but some hours to fix.

Resetting a Device in Xcode Organizer

I've made many mistakes in the process of adding a device to the organizer to deploy to it.
I want to completely start over, but every time I delete the device, unplug it from my computer, and re-add it, it already recognizes it, meaning the "Use for development" option is unavailable, and the error "Xcode cannot find the software image to install this version" always pops up.
How do I just start from scratch??
Any suggestions will be greatly appreciated. Thanks.
And this is very urgent, thanks!
UPDATE:: Have these errors constantly pop up -
Provisioning Profiles - VAlid Signing identity not found
2.Unable to codesign using identities in this team: no provate keys available
3.Software version - XCode cannot find the software image to install this version (5.1.1 (9B206) )
I figured it out.
You can start from scratch by going to "Keychain Access." Go to passwords, and delete your appleID. Then, it will prompt you for your apple ID again.
To resolve the specified issues, you need a development certificate, which will automatically be requested only if you login using your account. Then the administrator will log in to his account and approve your request. Once the certificate is created, it will still not work.
You need to download both the certificate to add to your certificates in keychains, and also the provisioning profile.

Resources