Your account already has a valid iOS Distribution certificate - Xcode error msg with signing app - ios

When I try to use the 'Export > Save for Ad Hoc Deployment' option in Xcode I am presented with a dropdown menu where it says the following :
To Save for Ad Hoc Deployment, select a Development Team to use for provisioning:
I only have a single option so once I click 'Choose' I get the following error message:
Xcode attempted to locate or generate matching signing assets and failed to do so because of the following issues: Your account already has a valid iOS Distribution certificate
When logging into my iOS Developer account I can see I currently have 3 iOS Distribution Certificates (5 in total) and all currently valid (e.g they expire in the future).
The Mac I am using is new, plus all the mobile iOS apps were developed by external developers/teams therefore I'm not sure which certificates I can safely remove.
As the certificates would have been made on other machines I don't have access to it isn't possible for me to simply export the existing developer profiles on these other Mac's and have them installed on my Mac. I'm also unsure if i can revoke current certificates? What is the worst that can happen when revoking current certificates?

As with most error messages in Xcode regarding certificates, it is not very helpful. I would do the following:
delete all the current certificates on your developer account
create new ones on your new machine MANUALLY (not through Xcode, so use the Keychain), this will make sure that the keys that sign your certificates are in your current keychain
update your provisioning profiles with the new certificates
sync the new profiles within Xcode (Preferences -> Accounts)
update your app settings
To this day I still manually do all my certificates and provisioning and while certainly not problem free, I don't seem to have nearly the nightmares that many people do. The only part of the process that I do let Xcode handle is to sync up the profiles.

Related

Unable to fix signing issue Xcode 7.3.1

I am trying to test my unity game on different iOS device using Xcode 7.3.1. Previously, I connect my iPhone 6 on mac and test the game successfully with free apple account(that has limited privilege).
Now I want to test that game on different device and later want to upload to app store. So I asked my client for apple id that has role "agent". I add apple id on Xcode and try to run the project with iPhone 6 connected. I got the error message saying-
"Your account already has a valid iOS Distribution certificate"
"You have a valid iOS Distribution certificate in the Member Center, but it is not installed locally. If your signing identity is installed on another Mac, you can export a developer profile on that Mac and import it on this Mac. You can also reset your current certificate."
Then I click on reset button to reset current certificate. And try to run the project again. Again I got the error message saying-
Unable to fix signing issue.
Xcode failed to resolve the issue. Check your code signing settings; ensure you have a matching signing certificate and provisioning profile installed; and try again.
I restarted Xcode many times but got the same error. Screenshot of my account details looks like below .
enter image description here
It is not enough, to login and download Developer profiles only.
You need that Certificate physically and signed in your mac as well.
Ak your client to export Signing identities and Provisioning Profiles.
This you will be able to import to you Xcode and Keychain in one step.
This process will help you handle private keys as well, as they are necessary if signing App using Developer/Distribution Certificate.
1) Your client has to export Identities and profiles:
2) He/She can send you them by e-mail:
3) You can import them all in one.
https://developer.apple.com/library/ios/recipes/xcode_help-accounts_preferences/articles/export_signing_assets.html#//apple_ref/doc/uid/TP40013306-CH8-SW1
When recreation of Certificates and Provisioning Profiles is needed:
Make sure you have appropriate privileges - you have to be team agent or admin:
1) Login to https://developer.apple.com with your developer credentials.
2) Go to Certificates, IDs & Profiles
3) Go to Certificates and remove the old one. Then Add new:
4) This is few step process, that requires you to create Certificate signing request. Just follow steps that are stated there. The last action in this step will be installing that Certificates - when ready, just click on it/them and they seamlessly get to your Keychain.
5) When finished with Certificates, open Profiles, find those marked with yellow triangle and edit them. Check the new certificate (and devices if you are creating Development profile as well). I personally prefer creating brand new profiles, as it it'll be easier to recognise older ones and new ones in Build settings later.
6) You now have to update your Xcode -> Preferences -> Accounts section and Xcode does this for you.
7) Last step - update Build settings in your projects according to your new profiles. You should be ready to validate you project now.

Problems with iOS Free Provisioning Profile

I've been using Xcode with a free Apple ID, and signing a App with a free provisioning profile.
However, after I signed the App with another Mac, the certificate on the first Mac I used to sign the App with does not work anymore.
I received this error message when I tried to run it on my iPhone:
Please verify that your device's clock is properly set, and that your signing certificate is not expired. (0xE8008018).
After generating a new certificate via Xcode > Preferences > View Details... > iOS Distribution > Create, I got this error instead:
The identity used to sign the executable is no longer valid.
After deleting the App from my iPhone, I tried to run the App again and received this error message instead. This also caused my phone to freeze for a while:
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /var/mobile/Containers/Bundle/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Test.app/Test
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Test.app/Frameworks/libswiftCore.dylib: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Test.app/Frameworks/libswiftCore.dylib'
(lldb)
Update: I'm using Free Provisioning Profile, thus I don't have access to iTunes Connect. I also can't import the certificate from my 2nd Mac as it was it was reset.
Update 2: I've also visited Keychain App and found 2 certificates - one expired and one valid. I deleted the expired one and tried to run the App on my phone again, but the error persists.
Update 3: I've tried to revoke all my certificates in developer.apple.com, but there isn't a certificates management. Only 'Programs & Add-ons' and 'Your Account' sections are available in the nav, which allows me to enrol into Apple Developer Program.
Update 4: I've also restarted my Xcode to no avail.
The main problem is that I'm not sure why I cannot revoke and regenerate a new certificate.
How can I solve this problem?
Generate a New CSR from your Keychain and download new certificate using this CSR. Include this certificate in your provisional profile and download it. Make sure you remove all expired certificates from Keychain. Good luck.
You don't need iTunes Connect to manage your certificates, IDs and provisioning profiles. iTunes Connect is used for managing your app store releases, which as you know you can't do with a free account.
You need to go to developer.apple.com and log in with your free account to the member center. You will be able to see the certificates and provisioning profiles under your developer account.
Since you don't have anything in the store (you can't with a free account), I would go into the developer's member center, revoke and delete any certificates that are out there, and delete all provisioning profiles. Start from scratch and generate a new certificate using a brand new CSR. Then generate a new provisioning profile using the existing app ID and the newly created certificate. Download the profile update your project settings to use the new signing identity and profile, and you're back in business.
Also, this is assuming that you are not sharing this developer account. If you are, doing the above instructions will make it so other developers will not be able to build with the signing identity unless you give them the private key for the certificate.
I managed to fix this problem by renaming the App name, and recompiling the App. I think that by renaming the App, a new certificate is generated, thus it would work.
Even though, it's not really a great solution, but it solved my problem as I wanted to rename the App in the first place.
Thanks everyone for providing answers!
I had to create a new Apple ID and it worked. Not the ideal solution but without access to certificates its the only solution that worked for me.

Wildcard App IDs can not be used to create In House provisioning profiles. Please use an Explicit App ID

I'm invited to a team to build an in house app. I'm granted as a team admin in Apple Developer Portal. The problem is that when I want to export the achieved app to a .ipa, it shows the message "Wildcard App IDs can not be used to create In House provisioning profiles. Please use an Explicit App ID." as the following screenshot. At the beginning, I login to Xcode/Preference/Account and download all provisioning profiles. Then I tried to login another account (who is able to export the .ipa) on Xcode/Preference/Account. Both trial lead to a same error message. Then I reset all my certificates and provisioning profiles on developer portal but in vain.
The interesting thing is that there's always a wildcard app id "*" on the developer portal, I tried to remove it manually but it comes back every time when I try to export the in house app.
I also tried the answers
Xcode 7.2: Failed to Locate or generated signing assets, Wild Card App IDs can not be used to create In House Provisioning Profiles
and this one
XCode export app, wildcard error
, nothing happened.
Any idea? Thanks for reading my question. I've already spend two days on this issue.....
Screenshot1
Xcode unable to create distribution builds for App Store submissions or Enterprise apps.
This issue occurs when the expired WWDR Intermediate certificate is present in both the System keychain and Login keychain within the Keychain Access application.
To resolve the issue, first download and install the renewed certificate.
Next, in the Keychain Access application, select the System keychain.
Select 'Show Expired Certificates' in the View menu and then delete the expired version of the Apple Worldwide Developer Relations Certificate Authority Intermediate certificate.
Your certificates should now appear as valid in Keychain Access and be available to Xcode. This issue is resolved in OS X El Capitan v10.11.4 beta.
from developer.apple.com

No identities were available - administrator request not solved by previous answers

I get the "No identities were available - administrator request" issue
I have a valid certificate, a match boundle ID, a valid provisioning profile (distribution) I have two apps, both I published 3 weeks ago to the app store with the configuration I currently have.
the only thing that changed is that I upgrade my mac to 10.9 and my xcode to 5, but left my device at IOS6
now both my apps failed to validate with the above error.
I tried the steps in many other articles like No identities were available - administrator request
or Xcode 4.3.2: "No identities were available" - Where to request a Dev Identity?
or https://discussions.apple.com/message/21603155#21603155
and others
nothing works
any idea ?
I spent two days reading forums and searching the web and finally figured out the problem. Under your IOS provisioning profiles, you have to have a profile that is listed as ditribution under type. It also needs to be listed under your account in xcode (xcode>preferences>account>view details) if it is not listed there, click the refresh button to have it check itunes connect for your certificate. I tried deleting every certificate and everything from Certificates, Identifiers & Profiles and let xcode create new certificates, but xcode says it will add distribution stuff and doesn't. Make sure to use your provisioning profile that is a distribution type for your provisioning profile under your code signing in both of the app target build setting and the app project build settings.
I had to go into Applications -> Utilities -> Keychains on my Mac and remove expired certificates. After removing those, I had to generate new certificates through the IOS Developer Site and import those into the Keychains application. After doing so, return to Xcode and in Build Settings, verify you are using the new Code Signing Identity and Provisioning Profile. (You will need both recreated, as revoking the Identity will invalidate the Provisioning Profile.)

iPhone: Can a dev other than team agent build an app for distribution

I have a company iphone dev account.
According to the doc, only the team-agent is allowed to submit a distribution cert and download the distribution provisioning profile.
Can a team only have 1 Team Agent?
Also, if that is the case, is there a way around this to allow multiple devs the option to build a distributed version of the app?
I have another developer who I would like to build and submit the app to itunes. I tried giving him the distribution cert and distribution profile. When he dragged and dropped them into xcode, and checked out windows->organize, it complains
"assigning identity matching this profile cannot be found in your keychain"
So this leads me to believe I need to get my key chain credentials on his machine. I tried exporting a private key and giving it to him, but he was unable to install it.
Is there anything else I can do?
I honestly thing its really silly if apple expects one developer to be responsible for building all apps for a company. Hopefully I'm wrong and there is a way to get multiple developers access to building a distribution of an app.
Thank you
NOTE: This process is heavily simplified in XCode 4 (although not personally tested by me) with importing and exporting of developer profiles through the Organizer window (Developer Profile section).
This is how I got it working.
1) Login to the iOS Provisioning Portal as the Agent.
2) Run through the process of making the Distribution Certificate Signing Request / Provisioning Profile: http://developer.apple.com/iphone/manage/distribution/index.action. These instructions a re super long, but pretty clear and necessary.
3) Pay extra attention to the section "Obtaining your iOS Distribution Certificate" > "Saving your Private Key and Transferring to Other Systems" on that page. It describes how to generate and save the Agent's .p12 file.
4) Now invite other developer(s) to be part of the team in the Member Center: https://developer.apple.com/membercenter/index.action#invitations
5) Back in the iOS Provisioning Portal, download the app's Distribution Certificate (Certificates > Distribution (tab)). Should be named "distribution_identity.cer"
6) Now download the Distribution Provisioning Profile (Provisioning > Distribution (tab)). Should be named "whatever_you_named_it.mobileprovision"
7) Email those two files along with the Agent's .p12 file to your other developer machine.
8) On the developer's machine, double-click the distribution_identity.cer file and it should load up in Keychain Access
9) Drag the .p12 file to Keychain and it should automatically put the identity under the certificate
10) Drag the whatever_you_named_it.mobileprovision file into XCode.
11) In each of the Project and Build's Info windows, set the Code Signing Identity to the "iPhone Distribution - Your Company" identity which should now be available.
Hope that helps. Rob
Just another tutorial step by step, but slightly different, the certificates have been already installed in the team's agent keychain, so it explains how to export the .p12 files from the keychain:
how-to-share-an-ios-distribution-certificate
You definitely should be able to build your app with a distribution certificate and profile on your coworker's machine.
Are you sure that the distribution certificate and provisioning profile are installed correctly? If you can build apps with the development certificate but not the deployment one, check to make sure that everything's properly installed in the keychain and that the correct provisioning profile is selected in the settings for the active target.
You can copy the private key in this way, but it's really UNSAFE:
Give him your login.keychain file (located in ~/Library/Keychains/), and let him open it with Keychain.app, and ask him to drag your private key to his login.keychain.
Apple also said you should keep your private key secured, if you need to reinstall your system, make sure you backup the login.keychain file.

Resources