IOS Submission No Certificate Found - xcode

I was working on my app and had all the profiles created. The build was working perfectly, but my mac had crashed. I just got a new one, so I lost what was in keychain access. I downloaded the profiles and certificates from developer.apple.com.
When I open the project in Xcode, I can select the correct profile but it cannot find the certificates (no signing certificate "ios distribution" found).
Anyway to fix this? I can't figure it out.

You need to create a new distribution certificate. It can be done in Xcode with:
Select Preferences… in the application menu
Select the Accounts tab
Select your AppleID
Select the team
Press the View Details… button
In the list of identities next to iOS Distribution, press the Create button
Alternatively it can be done by following a guide in the Apple developer member center.
The iOS distribution certificate is used for Ad Hoc distribition, Enterprise distribution and submitting the app to the App Store. It is not used when end users download the app from the App Store.

Related

Xamarin and Choosing Provisioning Profile for Distribution via Mac App Store

I'm trying to upload a mac app to the Mac App Store. I have done
this successfully with an iOS app, but this is the first time with
a mac app.
I have an Apple Distribution Certificate:
plus a Provisioning Profile for the Mac App Store which used the above cert:
The Cert is installed on my machine (downloaded it, double clicked). I can see it
in Keychain Access.
I now want to upload the Mac App to the AppStore.
Per this document, I need to set the developer ID and provisioning profile for the application and installer package.
So in Visual Studio 2019, I open preferences and head to "Apple Developer Accounts", select my dev account, my apple ID, and click "View Details". I see my certificates there, plus my Provisioning Profile "XXXX Mac App Store Provisioning Profile" (per the above diagram). Note that I have previously clicked "Download All Profiles" to get this profile installed locally.
I now open options for the Mac App project itself, select "Mac Signing".
Here's where things get weird:
a) The identities are correct. So I select the correct Developer ID.
b) the provisioning profiles are not correct. In fact it contains 2 old
entries, and 1 entry I have not heard of. It does not show any of the
provisioning profiles from the "VS | Preferences | Apple Developer Accounts".
c) It does show my "Developer ID Installer" cert for the installer.
Since I can't select any of my profiles, I select:
Identity: My Developer ID
Provisioning Profile: Automatic
Installer Package Identity: my "Developer ID Installer" cert.
I rebuild, "Archive For Publishing", and then attempt "Sign and Distribute".
I select "App Store" and get "No valid Provisioning Profile found"
What am I missing here? VS can see my profiles and certs.
But in the specific Mac project, those profiles do not show up, only some
old cruft.
I'd appreciate any advice. Thx.
Paul.
My comment above resolved the issue:
Apple Distribution certificate (which is SUPPOSED to be for MacOS,
tvOS and iOS) doesn't work in Xamarin for Mac apps. However if I used
Mac App Distribution certificate, and create a Mac App Store
Provisioning Profile using that Mac App Distribution certificate -
they both show up in the App Options | Signing. WTH?
Bottom line is that you need to use Mac App Distribution certs, not Apple Distribution certs.

How do I resolve problems with my Signing Certificates in Xcode

System Preferences / Manage Certificates
The above is a picture of the System Preferences/Manage Certificates area of Xcode (rev 11).
I know this is quite messy, but I'd like to ask the community for help in cleaning up my signing certificates for Xcode.
I am to the point where I cannot Archive any app in Xcode, even a "Hello World" app, due to the state of my signing certificates. I am a paid up developer on Apple Developer.
Below is a picture of the Key Chain Access of my system.
Thanks in advance.
LeonW53
[Key Chain Access Image][1]
I am a little the wiser now.
In order to submit to the Apple App Store, you need a Distribution Certificate and an IOS Distribution Certificate. Both must have the Public and Private key.
The Private Key refers to the computer from which the app will be submitted. The Private Key is password to the Mac that will archive the app and submit.
To start, you need to go onto your distribution Mac and open the Keychain Access app (Applications/Utilities/Keychain Access). Once in, at the top of the screen, go to Keychain Access/Certificate Assistant/Request a Certificate from a Certificate Authority.
Note 1The Request requires a user email address. Use the email address that you use to log into the Apple Developer Site. You do not need a common name. Select Request is Saved to Disk and Continue. You will be allowed to pick the name and Save Folder for the Certificate. Click Save.
You can create All of your Certificates from this one Certificate Signing Request.
Go into the Apple Developer Website and sign in (you need to be paid up to do this). Use the Apple ID that you used to save the Certificate.
Go to Certificates, Identifiers and Profiles.
Click Certificates in the left column. Click the + next to Certificates to add a new Certificate.
You will be asked to what kind of Certificate to Create.
You need to select Apple Development to develop an app on your mac. You may need an iOS App Development to develop iOS apps, but I haven't found this necessary
To Upload and Distribute your app, you need Apple Distribution and iOS Distribution.
Whichever one you pick, click Continue and you will be asked to Upload a Signing Certificate Request. Here you browse to the Certificate Signing Request that you saved (Note 1 above). Click Generate and the Certificate will be created. Click Download and the Certificate will be downloaded to the Downloads folder on your Mac.
You can create several different kind of certificates and you do NOT need to re-create the CSR -- use the same one over and over.
On your Mac, you can just double click the Certificates downloaded and they will be added to your Keychain.
In XCode, select the App root of the App Folder Tree and open "Signing and Capabilities". Select the Team that you have in the Apple Developer Site from the drop down list. Also select Automatically manage signings.
Also in XCode, you go to XCode/Preferences/Accounts. You should selected the Apple ID on the left which is the same as you log into the Apple Developer Account. On the right, you can select the Team which will do the Uploading and click Manage Certificates. You need valid iOS Development, Apple Development and Apple Distribution Certificates.
Note 2 If there are any Certificates that are missing the Private Key, this is because either the CSR was generated on a different PC to your current PC or that you were not logged in as the same developer on the Apple Developer Site. This happened to me, and it was because I wasn't logged into the Developer Site the same as I have logged on my PC in System Preferences.
If you Archive, and you have missing Private Keys, the Archive will ask you to log into Keychain using the password which unlocks the PC for EACH and every missing key. Once done, the archive will be created.
Note 3Make any mistake on this, and you will generate a failed archive with a non-zero exit code. Apple provide no clue as to how to solve this.
My current situation is that I have valid Apple Development, iOS Development and Apple Distribution Certificates and I can archive. In addition to the valid Apple Distribution Certificate, I have two Apple Distribution Certificates which are missing private keys. But, I can archive the app.
Be kind and be safe all.

macOS App manually signing with provisioning profile for App Store got error Code signature invalid

I try to use manual signing in macOS using provisioning profile. But everytime I try to run it will crash with error
EXC_CRASH (Code Signature Invalid)
If I try to use automatically manage signing or manually manage signing but without provisioning profile it works fine. What is wrong with my provisioning profile? I need to use manual manage signing because my app actually is Xamarin.mac which is not possible in VS for Mac to sign automatically or sign manually without provisioning profile. I am not using weird entitlement. I only need app sandbox to release app store so in my provisioning profile I don't add any capabilities
If your signature is invalid it is likely that you haven't created the correct type of certificate. There are several certificate types that can be instanced and your app will not build correctly if you have created the wrong certificate type.
Common certificate types include:
iOS development
iOS distribution
Mac app development
Mac app distribution
Mac installer distribution
Developer ID application
Developer ID installer
For more information about manually creating your certificate, see my answer to this question: macOS installer certificate evaluation error in Keychain: Invalid Extended Key Usage
Also note that during development you would use an iOS development certificate, but for uploading to the App Store via iTunes connect, you will need an iOS distribution certificate and it needs to be enabled on an Apple ID that has paid for iOS distribution. For more information on enrollment to the Apple developer program, which will enable you with privileges to get a valid distribution certificate see here: https://developer.apple.com/support/enrollment/
If you are sure that it is not a problem with the certificate itself, do note that there other parameters involved when creating a provisioning profile manually - it's not just a certificate + private key. This is a profile that needs to be created in the Apple developer portal, but as long as you have a valid Apple ID to use for creating the provisioning profile it shouldn't be difficult. There are detailed instructions here: https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/manual-provisioning but allow me to paraphrase:
1) Go to the Apple Developers Member Center (https://developer.apple.com/membercenter/index.action), and under the section Certificates, Identifiers & Profiles select "Provisioning Profiles".
2) Click the + button, in the top right corner to create a new profile.
3) From the Development section, select the radio button next to iOS App Development, and press Continue:
4) From the dropdown menu, select the App ID that to use
5) Select the Certificate(s) to include in the provisioning profile, and press Continue
6) Select all the devices that the app will be installed on, this will be all the devices and computers that belong to your Apple ID that will get a distribution certificate installed on it.
7) Provide the Provisioning Profile with an identifiable a name, and press Continue to create the profile
8) Press "Download" to download the provisioning profile onto a Mac
9) Double-click on the file to install the provisioning profile in Xcode. Note that Xcode might not show any visual clues that it has installed the profile except for opening. This can be verified by browsing to Xcode > Preferences > Accounts. Select your Apple ID and click "View Details..." Your new provisioning profile should be listed, as illustrated below:
After the provisioning profile has been successfully created it may be necessary to restart Xcode so that all the development certificates are correctly loaded and available for use.
Checklist:
Is my code signing certificate the correct type
Was my provisioning profile properly registered in the Apple Developer portal (https://developer.apple.com) for the Apple ID that is used on the machine building the app
Is my Apple ID correctly enrolled in the Apple Developer program with no outstanding fees to be paid, or licenses like EULA to accept.
Have I downloaded my provisioning profile from my Apple Developer portal and correctly installed it on my machine that is trying to build / release the app.
NOTE:
In order to distribute apps to the app store there is no choice but to create and pay for the provisioning profile within the developer portal, and install it on your machine by downloading it from Apple.
Best of luck!

Xcode 8.3.2 signing errors

I have Xcode 8.3.2 on Sierra. I am trying to build an Enterprise .ipa (have Enterprise membership).
I am having issues signing my app. Specifically in Xcode I have the following under General\Signing:
Automatically manage signing is enabled
Team: "My Team (Enterprise)"
Provisioning Profile: Xcode Managed Profile
Signing Certificate: iOS Developer
Status
Failed to create provisioning profile "com.myapp" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.
No profiles for 'com.myapp' were found. Xcode couldn't find a provisioning profile matching 'com.myapp'.
My steps were:
Logged into Enterprise account at https://developer.apple.com/account/
Under Certificates, Identifiers, and Profiles I selected the Add
Selected In-House and Ad Hoc
On my MAC in the Keychain Access I selected KeyChain Access\Certificate Assistant\Request a Certificate from a Certificate Authority
Saved to my desktop
In https://developer.apple.com/account/ I uploaded the certificate signing request
I see it as a certificate as type iOS Distribution with and expiration date
I download the .cer file and double click on it to install it
Within Xcode\Preferences I find the Team under the Apple ID and under Manage Certificates I see iOS Distribution Certificates and Enterprise with today's date
I select the Download All Profiles for that team
In Xcode I select General\Signing and "My Team (Enterprise)
At this point I get the two errors described above.
I am new to Xcode development so I am sure there is something wrong with my steps.
Any insight would be greatly appreciated.
Well the solution to my issue was to do the following:
In Xcode under the "General" tab to disable Automatically manage signing
At https://developer.apple.com/account in my enterprise account under provisioning profiles I created a new distribution profile
Downloaded the profile => .mobileprovision file
Double clicked on the .mobileprovision file
With Automatically manage signing disabled I then selected the Provisioning Profile I just created and downloaded in the drop downs for Signing (Debug) and Signing (Release)
At this point I was able to archive and export an enterprise .ipa
This is the solution to my issue that's similar to this one:
Change your bundle identifier to a unique string to try again.
Your bundle identifier is already in use by other developers I guess, so just change your bundle identifier in the Identify tab right above your Signing tab to another one:
For example:
Bundle Identifier: org.react.native.example.RamenForLifeIn2022
Hope this helps :)

How to build IPA for distribution with TestFlight with XCode 5?

In XCode 5(.1.1) how to I get an IPA for distribution via TestFlight?
I set the code signing identity and provisioning profiles for the release to my distribution profile
I build the archive (Select iOS Device from the menu, then Product>Archive), which succeeds.
I select the archive in the organizer and click "Distribute..."
I choose "Save for Enterprise or Ad Hoc Deployment
I choose my distribution profile (same as in 1 above)
I click export.
XCode gives an error message
Code signing operation failed
Check that the identity you selected is valid.
What should I do?
Update:
I deleted my certificates, app ids, and provisioning profiles from the apple dev center, and from my keychain access (locally).
I recreated the certificates, app id, and ad hoc provisioning profile.
I synced my info into XCode from the dev center
I updated the code signing identity and provisioning profile build settings for the project and the target to use the new distribution provisioning profile.
I archived the project again.
I clicked distribute in the archive organizer
i chose ad hoc
i chose my new ad hoc distribution profile (from above)
I get the same error
Code signing operation failed
Check that the identity you selected is valid.
(#mohacs suggestion) When I try to validate the archive, I get
No application records were found.
Applications must be ready for upload on iTunes Connect before they can be validated or submitted from within Xcode.
(#threeve suggestion) When I read on Code signing fails for Cordova app (using XCode 5.1.1 and Cordova 3.4.1-0.1.0) to check the (System) Console (thanks #shedd), I am not sure where to look, but under "System Log Queries," I looked in "All Messages," and I see no messages during my attempt to "Distribute".
Thanks to #shedd and #threeve https://stackoverflow.com/a/25212574/1449799 THE ISSUES IS FIXED! Despite being unable to find any error messages in the Console, from www, I removed Gruntfile.js, karma-e2e.conf.js, karma.conf.js, and the entire node_modules directory.

Resources