Distribution provisioning profile will not be set to "Active" - ios

The distribution provisioning profile that I use for my iOS app "BodBot Personal Trainer" has been working without issue for the past several months. Without any change from my part, it became invalid. It appears that the accompanying Certificate had expired a few days before I found that the profile became invalid, so I assumed I just needed to "Generate" the profile again. This did not work. I then verified that the related App ID was fully functionality, which it was. I then created a new Certificate as well as a new Provisioning Profile associated with that Certificate. None of these actions seem to successfully result in a working Distribution Provisioning Profile associated with my App ID.
Odd note: Each time I Generate the Provisioning Profile, it shows up as "Active" for around 10 minutes, at which point it shows up as "Invalid"
Question: There's little/no detail as to what is going on here. Any help, even if it's just a place to look for additional data for a diagnosis, would be very much appreciated. When it comes to provisioning profiles, I'm pretty lost.

This sounds like symptoms of automatic provisioning resolving done via XCode. Even though it works sometimes, it's good practice to avoid using this feature, as usually it is invalidating current profiles for some reason.
Consider trying out brand new tool by F.Krause, which will allow to centralise provisioning profiles and avoid their constant invalidation/re-generation.

Related

Development Provisioning Profile appears ineligible, with no apparent repercussions

So I recently created some provisioning profiles and am handling them manually in order to insure the correct use for push notifications. However, my Development profile appears under a heading of Ineligible, but seems to be accepted with no warnings or anything. Am I misunderstanding the meaning of eligible/ineligible in this situation? In the screenshot, you can see which profile is for distribution and which is for development. The fully crossed out one is just the wildcard
Maybe this profile are made under another distribution cert which is not use in your project ?

Appcelerator - CodeSign issue since adding new UDIDs to provisioning profile

I recently added some new UDIDs to my AdHoc Distribution Provisioning profile. I then downloaded the updated certificate and since then I have been able to publish my iPhone app as I keep getting a 'Codesign' issue.
I've tried everything seen in many other posts on this forum including deleting and recreating my developer and production certificates and deleting and recreating my provisioning certificates (Both Developer and Ad Hoc Distribution).
I now can't even 'run' the app to my iPhone attached to the computer (which wasn't one of the new UDIDs - deployment to this phone has always worked).
I'm at a loss where to turn as
Apple tells me my Provisioning Profiles are 'Active'
Xcode shows the correct Provisioning profiles
My Key Chain tells me I have two valid certificates (one iPhone developer, one iPhone Distribution).
Appcelerator gives me all the ticks when I am choosing which profiles to use in the build
I have been 'cleaning' my app and restarting Appcelerator like crazy but with no luck
I really need to get this app over to the client, but have no idea what is 'wrong' as everything matches up. Is it possible Xcode has cached old certificates? Has something got corrupted?
I have been through this issue in past month, the problem was exactly same as yours, everything was showing correctly.
But from your Keychain screenshot, I think there is no private key (this was my case also) attached with your certificates which is the issue of CodeSign.
If you even install the .cert file, it will still show it as a valid certificate, but you might not be able to sign your code due to missing private key.
So, make sure you get the private key added along with the certificate in your keychain. If it does not works for you then you should create new certificates from same machine you will distribute the app as it will save a lot your headaches :)
As is often the case - this was a very simple issue wrapped up as a complex one.
When creating a build (both under 'Run' and 'Package'), you can select which KeyChain to use. Somehow this dropdown had changed from 'System Defaults' to another one... changing this Select KeyChain drop down back to System Defaults was all I had to do!
Thanks to #prashant-saini for getting me thinking about keys and keychains!

Expiring In-house Distribution provisioning profile and certificate

I have an in-house enterprise app that is managed (deployed) from MaaS360
'https://portal.fiberlink.com'
And this app is built (and still maintained) in XCode 4.6.3 (i know, i know), so I don't have any of the fancy new features in XCode 7 that might help alleviate this problem. In fact, even the refresh button in Organizer no longer works... you tap it and a dialog says "service unavailable" and I've tried it on different days, so it's not just a temporary glitch or service interruption. I believe apple disabled whatever portion of their service was servicing that request from XCode 4's Organizer.
The provisioning profile on it is going to expire in March, and I'm trying to figure out how to renew it without inconveniencing the users by making them download a new rebuilt app. It would be particularly painful for them because it would require they sync a few gigabytes of data from their device through iTunes for each person, and it's a few hundred people.
My problem is, my certificate I used to sign the app is also expiring around the same time (in March).
I happened to have another certificate and an associated provisioning profile, I had generated on a different mac which expires in 2019, and I tried to use it to update the expiring provisioning profile on MaaS360 for this app in question, and I get this error
So what has me a little terrified is, I'm back on the mac where I originally created and deployed the app... if I need to renew my existing certificate (which I assume means revoking it and replacing it with a new one), in order to create a new provisioning profile, aren't I going to run into this dialog again, claiming that my certificates don't match, because I'll now have a new one, hence I can't update the profile.
If the only way to update my expiring provisioning profile is with my soon-to-be-expired-but-also-identical certificate which originally created the profile, that still means my profile is going to expire as scheduled because my original certificate will have expired too.
Is there a way out of this dilemma?
You can have two certificates active at the same time. So I would generate a new certificate using the same key you used to generate the original one. To do this on the Apple developer portal, you will need the cert signing request. Most developers don't save this when they generate their certificate the first time. The good news is, if you have the private key that was used for your distribution certificate, you can use that to generate the CSR. To find out if you have the private key, you can use this post for how to locate it in the Keychain app. https://stackoverflow.com/a/33651921/3708242
Once you have verified that you have the private key used for the certificate for the app store distribution, you can generate the a CSR using the following procedure: https://stackoverflow.com/a/7111454/3708242
Once you have the CSR, go to Apple's developer portal and generate a new distribution certificate for "In-House and Ad Hoc" distribution. As long as you only have one out there, you should be able to create a second without having to revoke the existing one. Once you've done that, you will likely need to provide that certificate to the MaaS360 service (I'm not familiar with how that works, but somehow the Maas360 server must have the private key and certificate that the apps were built with, as it is clearly checking that when you push the build of your app and the certs don't match). So download the new cert and provide that to MaaS360.
Then, generate a new distribution profile using the new certificate. Or you can update the existing one to use the new cert by clicking the edit button on the provisioning profile, then changing the radio button to the new cert which should expire several years out. Note that this won't prevent any existing apps built using the profile from running in the meantime (revoking the certificate, however, would immediately cause the apps to stop working, which you don't want). Save and download the new profile, and use it to rebuild the app.
The app will then be built with the new certificate, that won't expire any time soon. I do think you are missing the part of the process where you will have to provide the new cert to MaaS360. I can't really help you with that part, but hopefully there is some documentation from IBM that can help you out there. But, you will need to fix it, because once the cert expires, non of the apps built with it will work. Good luck and let me know if any of this is not clear enough.

Provisioning Profiles was invalid but Certificate and App ID are valid, why is that

My provisioning profile suddenly became invalid.
I logged in developer.apple.com couples of days ago and everything was fine. Today I logged in again and was surprised to find that both of my development profile and distribution profile were invalid. The certificates and App ID are valid, I did not revoke any of them and they are not expired at all. So why my profile became invalid?
I know I can re-generate profile but because I do enterprises distribution not app store distribution. I am worried that regenerating profile may affect current users. Also, I really need to figure out the reason to prevent it from happening again.
Any idea? Thanks!
Updated: First of all, it is not because the profiles were expired, their expiration date is at the end of 2015.
Second, I did re-generate development profile at morning but I just checked it and found the profile was invalid again! Something weird must happen and I have submitted a support ticket to apple and wait for their response.
I'm curious to see what Apple support says. According to Apple (https://developer.apple.com/library/ios/qa/qa1878/_index.html) :
Q: What causes the provisioning profile "Invalid" status? How do I resolve it, and how do I prevent it?
A: The provisioning profile invalid status is caused by changes to the profile’s associated certificate or App ID. Any time an App ID or certificate changes, all profiles that are associated to it are marked Invalid. This does not apply to Xcode's team profiles, but applies to all profiles that Xcode does not manage, specifically, custom development profiles and distribution profiles. This document explains the causes in detail and provides steps to resolve and avoid the profile invalid status.
One possibility is that you modified the app id by turning on or off services in Xcode:
Avoidance
Since Xcode started managing services on App IDs (through the Xcode >
Target > Capabilities tab), Invalidating provisioning profiles became
as easy as enabling or disabling a target capability. Remember that
every time the App ID changes with respect to its enabled services,
all profiles attached to that ID become invalid.
Hope this helps.
It seems that somebody still hits this problem after almost a year when I first raised it. So I am answering my own question trying to provide some insight.
Apple never answered my ticket instead they returned my credit. I took that as a sign that they had no idea either (saw my comments above). I can still use that "invalid" profile but it really made me uncomfortable. So I created a different one.
In summary it maybe just a bug in their system and if you have tried all the solutions and the problem still exists just create a new one.
If you generate a new provisioning profile, your old installations (store or adhoc) won't be affected
The provisioning profile lives for 1 year, maybe it expired so simply remove it and make another one with the same certificates, app ids and devices and you can use it without any problem
EDIT:
I don't know a case where a provisioing profile would become invalid unless:
It reached its expiry date;
You modified the app id or certificates that are related to it.
I guess it's related Automatically manage signing in Xcode. In case you switch to another branch which has different configures in Xcode > Target > Capabilities, Xcode will change your App ID settings
If you generate a new CSR for something like an APNS certificate, it will mark your provisioning profiles as invalid.
Guess I found the answer, it's simple go to the apple developer account and select those certificates which wasn't working.
1.Edit them and simply add some new name just to remember.
Select same App Id and certificate for both development profile and distribution profile and hit the download button
After downloading add them into you Xcode and you will them there.
it generally happens when you update your Xcode, so be sure when you check certification where Xcode is mentioned(For use in Xcode 11 or later in my case)
For me it's just opening the apple developer account, edit the profile, save it and download the provisioning. Made a new build and then reupload it.

Certificate identity 'iPhone Developer: ' appears more than once in the keychain. The codesign tool requires there only be one

Ok, I am completely pulling my hair out on this one.
Back in July I created a provisioning profile so I could test on my iPad.
Then at the end of August I tried submitting my first App to the iTunes Store. The process was a complete nightmare, and I struggled. A lot. In the end I found a tutorial with relatively recent information in it, and only by following it step by step could I actually get anywhere with this. Unfortunately the result of this was that I created a new provisioning profile.
Now when I try to test on my iPad I get the following error in Xcode:
Certificate identity 'iPhone Developer: MyName' appears more than once in the keychain. The codesign tool requires there only be one.
I check the keychain, and sure enough there are the two provisioning profiles for development, one from July and the one I used to submit to the iTunes Store in August.
Now what I want to do is get rid of the old one, and then connect my iPad up to the new one. I can get rid of the old one fine, but I cannot connect my iPad to the new one, it insists on using the old profile, even to the point of re-attaching it to the keychain after Ive deleted it.
Can anyone tell me:
How to connect my iPad to the new provisioning profile?
And while we are at it, can anyone shed any light on why this entire process is so convoluted and difficult? Considering that so much of Apples interface is so well designed and fluid, this process of registering certificates and applying them to different devices and Apps seems so backwards. I initially suspected this was just me, but googling for these error messages reveals that there are many who are struggling at various points along this process.
This has nothing to do with Xcode and everything to do with keychain.
Open keychain.
Find the signing certificates that are tied to your provisioning profiles.
Delete one. You probably want to keep the newer one, so look at the expiration dates and remove the one that expires first.
Restart Xcode
You may need to update your provisioning profile if it isn't tied to the new certificate, but it won't be as painful as creating a new certificate.
Here's a broad overview of how code signing in Xcode works. It a bit much but will explain what's wrong with your configuration, and how you can fix it.
There are three parts to the mechanism that ensures that you are who you say you are and that your app is allowed to run where it wants to.
You've got a pair of keys, one public and one private. Your public key matches your private key, which identifies you.
Your keys are used to generate certificates. Generally, you'll have one certificate for development and one for distribution,either on the App Store or via Ad Hoc distribution. These certificates permit you to provision your apps.
Each certificate is used to generate provisioning profiles. The profiles must be attached to either a development or a distribution certification. A distribution profile either works on the App Store, or it contains a list of device IDs which may run apps signed with that profile.
If your certificate is expired, the provisioning profiles that are created with it are going to be invalid. In this case, replace both the certificate and the profiles. Generate a certificate signing request (CSR) from Keychain Access and upload it to the developer portal.
If you have multiple certificates in your keychain, Xcode won't know which one to use. This may happen if you renew your certificate and don't remove the old one. (It may also happen if you exported your developer profile and then imported it later. Your old certificates will carry over.)
If your provisioning profile is expired or invalid, you can renew it in the developer portal without generating a new CSR. You can just attach it to an existing valid certificate.
Certificates can't be carried over from one machine to another without moving the original key pair that requested it. Exporting the certificate from Keychain will export the keys as well.
Delete the old one, and start build with new.
One more way you can try , set code signing identity with profile you want to run in both target as well as project build setting.
Hope it will help you.
Otherwise you have to delete old one.

Resources