How do I regenerate Xcode managed provisioning profiles? - xcode

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.

Related

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!

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

The Automatic Device Provisioning options have gone since upgrading to Xcode 4.3.1?

I'm making a release for the first time since upgrading to Xcode 4.3.1.
While having a look to see if my profiles were up to date I also noticed that automatically updating device provisioning is no longer displayed (i.e. where it should appear in this screen shot doesn't appear for me How to add a new device to a team provisioning profile) but it used to there before I upgraded.
Is this something that has been removed with 4.3.1? If not, why is it no longer appearing for me?
xCode 4.3 now has the Refresh link on the far right, and there is no longer a checkbox for "Automatic Device Provisioning," at least that I can find.
Just clicking the Refresh link on the right is all that's needed to update the app's provisioning profile from developer.apple.com.
I'm not seeing it either. I'm having lots of troubles with code signing and ad hoc distribution, so I'm trying to follow Apple's (recently updated!) step by step instructions. However, they don't appear to match the options I have in XCode. It appears that "automatic device provisioning" has been silently removed as an option, or my Organizer install is corrupted.

xcode build to iphone chooses old invalid provisioning profile

I've just gone through some pain with iphone and xcode upgrades and keychain failures etc and decided to uninstall xcode completely and re-install. This fixed my keychain issues however the project I am working on appears to be linked to an old invalid provisioning profile.
I've deleted the profile from "Provisioning Profiles" in organiser, and removed it from Provisioning on the Iphone section of Organiser. However when I build an go with the iphone sdk rather than simulator i get the pop up "codesign wants to sign using key "OldKey" in your keychain".
It appears the actual app is associated with the old key and I can't seem to find how to point it to the new valid one.
Crazy thing is at some point I managed to get it to work and install but the application crashed and won't open. I've not managed to get it to install again.
Any ideas?
I ran into a similar problem. To fix:
1) In organizer, delete the profile from the phone.
2) Also in organizer, delete the profile from the Provisioning Profile list.
3) Finally, search your computer for provisioning profiles and delete the old ones directly.
After that, drag in the new profile and it will work.
This caused me all manner of problems! Open the app.xcodeproj package and drag & drop the project.pbxproj file into text-edit. Do a search for "PROVISIONING_PROFILE" and delete the profile ID. restart xcode and build, hopefully it should pick up the new provisioning profile and forget about the old one that was causing you issues.
Note: Be sure to do a backup of the project.pbxproj file before editing it.
xCode 4 -reinstalls keychain certs that I delete

Resources