Code Sign Error : Distribution iphone App - ios

I have an iOS project to open and when i open it i get an error -
Code Sign error: The identity 'iPhone Distribution: x' doesn't match any valid, non-expired certificate/private key pair in the default keychain
What i have now is a file named given to me by the project owner-
CertificateSigningRequest.certSigningRequest
But i dont know what to do wit it. I created a CA and all that but i cant get it to work. Can anyone point me in the right direction?

Ok so here are detailed steps on how to distribute. You seem new to the topic:
You want to request a development and distribution certificate in Keychain Access (I see you have done that) and upload it to developer.apple.com (you are part of the developer member program right?)
Create an app ID (in provisioning profiles)
Create a distribution certificate - make sure this and step 2 follow your bundle ID
Download the profile and drag to Xcode
Go to your Xcode project, in the target or project build settings set your code signing option to the Distribution certificate (which must match your Bundle ID and of course your distribution and development certificate)
Now go to edit scheme -> then change from debug to release
Set to build for an iOS device (or none at all)
Go to product -> Build For -> Build For Archive
Scroll down on the side (your classes tab etc.) to the product which should be named (AppName.app) and show it in finder.
Create an application on iTunes Connect
Compress the .app and load it to Application Loader
Send it off!

You need to public and private key for the provisioning profile you are using.
The person how created the certificate with which the provisioning profile is signed will have to supply you with them.

Related

Xcode won't recognize my new provisioning profile. No matching signing identity found

I'm trying to configure Push Notification on my iOS Project. These are the steps I'm doing:
Creating the SSL certificate: I'll go to Keychain Access > Certificate Assistant > Request a Certificate and save it locally.
Creating an App ID: App dev, Explicit App ID (Checked programmatically at Xcode to make sure is matching the same id)
Configuring the App ID for Development Push Notifications: Go to settings click on "Create certificate", then attach my already created ssl certificate. Then generate and then download
Creating the Provisioning Profile: I select iOS App Development Choose the App ID you created in step 2, I Make sure to select the iOS Development certificate then select all the devices. Give a name to the profile, I download it and then run it.
Then I go to Build Settings", and find (or search for) the "Code Signing Identity" field and make sure it matches provisioning profile installed earlier.
After that, when I click run I get "No signing identities (i.e. certificate and private key pair) matching the value specified in your build settings, "Apple Development IOS Push Services: com.myappbunde.appName", were found. Xcode can update your build settings to their recommended values. "
Things that I tried to solve the issue:
Xcode -> Preference -> Accounts -> View Details -> Click on Refresh. After this, I actually see my provisioning file with a correct expiration date and everything, clean, then build but same error.
I even tried creating a different Bundle ID, repeating the steps mentioned on the first paragraph but no luck so far.
Help.

can't resolve "valid identity is not found"?

I'm trying to develop my first iOS App on my mac (OS 10.8), the application contains a push notification service. I followed the below steps to create my App ID:
Give a name to the APP ID
Set the Bundle ID.
Check the Push Notification checkbox
Create App ID
Generate a certificate, by uploading the request created by key chain access, then downloading and installing it on key chain access, exporting into .p12 file.
Create Provision Profile, Download and install on my Xcode organiser (XCode 4 updated version) and on my device to test.
The project work well on the simulator (except get the token and that's normal). However when installing the provisioning profile on the Xcode Organizer it gave me :"valid identity is not found".
Checked and tested Many Solutions:
Delete Cert from Dev Center and Key Chain Access.
Delete Provision profile recreate it.
Install provision profile directly from Xcode.
Delete Created Keys from key chain and create new ones.
Many suggestion has been provided:
Your Keychain is missing the private key associated with your iPhone Developer or iPhone Distribution certificate.
Your Keychain is missing the Apple Worldwide Developer Relations Intermediate Certificate.
Your certificate was revoked or has expired.
Online Certificate Status Protocol (OCSP) or Certificate Revocation List (CRL) are turned on in Keychain Access preferences
None of the above fixed the problem.
Would you please provide a solution for this problem and thank you in advanced.
i had discover my problem. i work in a company and there is my partner have generate the developpements certificate on his own mac. i work on a different mac. so what i need, he must export the key and the certificate from his key chain access and give it to me.
that's it.
beginner's problem :d
First of all make sure your Bundle Identifier match with the bundle Identifier included in the provisioning profile. And you have correctly added your iPhone's UDID to the developer account under devices and then add the bundle identifier and device to the provisional profile. Also make sure you have requested the certificate from your own Mac and then installed the certificate after downloading it from the developer account. And there will be a key under your certificate.
Many things may go wrong, so simply try these steps, even if you've done them before.
Make sure your Bundle identifier is the same at both in Xcode and in iTunes Connect, it's a good practice to fill it manually instead of Xcode's template, as it IS case-sensitive.
Check that your testing device's UDID is listed on the Devices list at developer.apple.com.
Create a new provisioning profile with a new unique name, for your app's bundle ID, make sure, again, that it's the same bundle ID (case sensitive) and make sure you have your newly-added device UDID (or the existing one if you had it correct before) in on the provisioning profile. Take a note of the developer certificate that the provisioning profile is bound to.
Download the newly created provisioning profile AND the development certificate that the provisioning profile is for. Clean your project's build folder (open Product menu from the menu bar, press and hold down the option button on your keyboard, and select 'Clean Build Folder...', exit Xcode.
Open both your provisioning profile and certificate. One should open in Xcode, the latter, in Keychain access.
In Keychain access, make sure you have the private key to your non-expired, non-revoked developer certificate. (if not, you need to either find its private key (e.g. in another keychain or in another Mac. It should be on the Mac that the CSR is created on, or if none are available, revoke it and create a new certificate, and start over this process)
In Xcode, make sure you are using the provisioning profile, NOT overriding it (e.g. you've selected a different value under 'Debug' or 'Release' options by mistake).
In Xcode, make sure you are using the correct development certificate (the one that is bound to the provisioning profile) and not overriding it under Code-signing identity section's Debug or Release, or in 'Any iOS SDK' sub-item underneath them. If everything worked, Xcode should offer you the correct certificate for your provisioning profile.
Your project should build. Seriously, I can't think of anything else.

No identities were Available

I have created new provisioning profile, certificate, etc. But when i archive my application for publishing to iTunes store it gives me an error that No Identites were available. An administrator must request identities before they can download. When selecting the download identities from dev center it shows my developer account but then comes back to the same screen going in an endless circle. How do i resolve this issue.
Make sure that your bundle identifier in your target -> info matches the one on your provision profile in the dev center.
Take a look at the Code Signing Identity in the Code Signing section under the Build Settings for your project. Make sure the identity there for Release matches up to a valid iOS Distribution role (under Preferences-->Accounts-->Apple ID-->View Details). Also, while there, check that the project's Distribution Provisioning Profile is there.

Issue with signing app with wildcard profile

I developed an iPad application to a client. My client has Apple Enterprise license. But they dont allow me to sign the app with their certificate. They just ask me to provide .xarchive file so that they can sign the app and create the ipa file.
This is how I have done that
1. Create a appid with com.mycompany.myapp.abc
2. Create a adhoc profile using above appid with my developer portal
3. set the bundle ID of my app com.mycompany.myapp.abc
4. Set the code signing identity to above profile in my app's target
5. archive the file using xcode 4.6.1
6. export the xarchive file and send to the client
7. Ask client to create a inhouse Dis profile with com.mycompany.myapp.* appid
8. Ask client to open the xarchive file using xcode and sign the app with inhouse profile and create the ipa file
They have followed above instructions in 7,8 and have created the ipa file. But when we try to install the ipa file using xcode to a device it gives following error.
Does above procedure has any problem. Can some one explain the issue.
EDIT:
for testing purpose I created adhoc profile with com.mycompany.* and created an ipa file by signing above xarchive file, it gives the same error message. But If I sign the xarchive file with profile crated with com.mycompany.myapp.abc bundle id works fine.
TL;DR:
Find out what the client's (provisioning profile's) entitlements are and make sure you match them.
The error is trying to say that the entitlements in your provisioning profile and their provisioning profiles differ. The difference could be a keychain group, push notification environment or something else.
The reason why Xcode asks you to choose a provisioning profile twice (once when archiving, once when distributing) is that all the provisioning profile entitlements are picked up in archive stage and mostly ignored in the distribution stage.
This makes it all too easy to distribute with the wrong entitlements, especially if your archive stage accidentally picked up a wildcard profile. Not your case, but that's why you should burn wildcard profiles with fire.
There are clever re-signing scripts (a.k.a. "Distribute..." button replacements) that will try to make the entitlements right by mashing what they find in the end user provisioning profile into your binary but I think the best solution is to make sure your provisioning profile's entitlements and any extra entitlements you add to your app matches their provisioning profile's.
I find Xcode's provisioning profile/entitlement system to be error prone. On hand you have entitlements that are basically part of your app's identity and may as well be set in stone (TODO: make your CI server check them). And on the other hand you have Xcode's build phase gleefully changing your app's entitlements based on its automatic/random provisioning profile selection. Silly.
You should follow the below step to make adhoc distribution .ipa for client
set bundle identifier in target info.plist
select the ad hoc distribution profile in target as well as in project
select iOS device then product-> archieve
organizer will pop up then select the archive and select "distribute" -> Adhoc Enterprise distribution
select the correct ad hoc distribution profile then save this .ipa file.
then send it to the client and let him know that before archiving or building the app we need correct adhoc provisioning profile . so there is no need to repeat the process at your end to set the provisioning or other stuff just distribute it .
How to distribute your iOS app over the air:
Just need to place the .ipa file and plist on a server and set the path in the above link example.

Code Signing Error

The company I am working for has a base app that they reskin and sell to different businesses. I have redesigned the app and am trying to upload it to their account but am getting:
[BEROR]Code Sign error: The identity 'iPhone Distribution' doesn't match any
valid certificate/private key pair in the default keychain
How do I add their developer account into my Xcode and acquire a certificate for distribution?
Thank you
Basically, you need to have maximum privileges in the Provisioning Portal to do the following, so if you don't, get it, and then do this:
Login and download a developer certificate. If you need to create one, select How To from the menu in the Provisioning Portal under certificates.
Download a distribution certificate. Again, if you need one, select How To.
Open both certificates and make sure they open in your Keychain Access
Select provisioning and download both a developer and distribution .mobileprovision provisioning profile. Create one if necessary using How To
Make sure you have XCode open and open both .mobileprovisioning profiles. Make sure that they open in the Organizer and show in the status that they are properly linked with a certificate that is valid in the Keychain Access. If they aren't, a flag will pop up, saying something like "There is no valid certificate associated with this profile" in bright red.
Check your code signing in both the Target and Project areas of your build. Make absolutely sure that both are trying to sign using your distribution profile.
Make sure that you are building the distribution scheme of your app (You may have to create this).
Finally set the build device to iOS Device, set the scheme to Distribution, and select Archive. It is imperative that when the program asks you to allow the code signing to use your private key, that you select "Allow" and not "Always Allow," as this is very buggy and often results in code signing errors.
If you need any more help, comment.
Hope this helps!

Resources