error creating ipa - iphone

I tried to follow this video to make an ipa
http://www.youtube.com/watch?v=gRhtsnFB0bM
but I have an error when I want to make Product > Archive
[BEROR]Code Sign error: The identity 'iPhone Distribution' doesn't
match any valid certificate/private key pair in the default keychain
It's the first time that I do that so I don't really know how it works, but I think it's a certificate problem. I made the app for someone. I downloaded his certificate from his account in developer.apple.com, what shall I do with it? Shall I make something in xcode to add it?

you need to revoke the previous provisioning profiles in his
account..(if you can get the previous person keychain files ..that
get that and install in your keychain..compiling will be successful)
make a new distribution certificate using keychain in your mac
and then make a new distribution profile using that distribution
certificate..then you will be able to compile using that profile.

I get this error all the time since I use the same scheme for testing as I do for distro. You will have to go into your build settings for the project and the target and set the code signing back to iPhone Developer. Clean your settings and rebuild. That should do the trick.

Related

Iphone Distribution error

I am new in iPhone Distribution . I created Apple ID U765UXW88D.com.edwincs.*. and
provisioning profile name is MobileHealthGuide. I made these in Distribution tab.
My xcode version is 3.2.4 While uploading application with application loader , I got this error
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate.
My project name is MobileHealthGuide too. I have tried revoking the certificate and provisioning profile, but the error persists.
How can I solve this problem?
I've encountered the same problem too. It showed that I had a duplicate certificate registration in my keychains. Removing one of them (I removed the one from my system keychain) fixed the problem.
Steps that helped me to resolve my problem:
Open KeyChain Access application
Select the 'login' keychain, and select in the bottom pane
'Certificates'
Switch to the 'system' keychain and see if there are certificates
registered in both chains.
Remove one of them
Rebuild the application
You probably need to check what code signing profile is selected in
your distribution build properties.
Alright, then make sure to clean the build & delete the Build folder from the app.
If this doesn't work for you, there is one more alternative :
Verify below steps to create distribution certificate and perform that if you miss anyone.
Generate a certificate signing request in keychain.
Using that create or revoke a DISTRIBUTION certificate in the
portal. after that download and install it and verify key under the
name.
Register the device in the provisioning portal.
Then create or modify a DISTRIBUTION profile in the portal. after
that download and install it and verify it appears to be valid in
Organiser as there are no warnings.
Make sure to select proper build setting in xcode.
Now this will definitely, solve your problem.
Make sure you added right code sign in project target.
Ok so here are detailed steps on how to distribute:
You want to request a development and distribution certificate in Keychain Access 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) - there might be a recommended or automatic profile, just choose the one that matches your identity and app provisioning profile and Bundle ID
Now go to edit scheme -> then change from debug to release
Then go to project than target than build settings and type in 'Code Signing', change the options to your distribution profile
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!
Tips:
Make sure you are using the correct Bundle ID
Try cleaning
Make sure you're certificate is not expired
Here is an expanded list of reasons why this may occur:
Upgrade your xCode! you are using a really old one.
Probably you tried it but go to https://developer.apple.com/ then iOS provisional portal there are lots of tools can help you.
If you are not using inApp purchase, push notification, iCloud etc. you can skip the App ID and just set a general certificate one that would be like U765UXW88D.* so that you don't need to do this process every time for new apps.
Make sure you created distribution certificate and sign with that on xCode for release/distribution.
On xCode itself make sure you defined the bundle ID same as on iTunes connect.
Good luck.
I've got a similar problem as well. In one project, using my dist profile, it works perfectly and I can build to a device.
In another project, when using the same dist profile, the app launches, loads the splash screen, processes the first page and then exits without throwing an error in Xcode or in its own log.
When I change the code signing to a generic dev profile, the app launches without a problem on the desired device.
I've redownloaded the certs, the dist profiles, deleted the old ones.
How is this even remotely possible? And how can this be fixed?
Failed signature verification can happen for many different reasons. See Apple's list of common causes in TN2250.
The most common reason for failing distribution signature validation is because the app was signed with a developer profile instead of a distribution profile, or the app was built with the wrong build configuration. To consider this potential cause check your settings against the recommendations that follow:
The Release build configuration must be assigned to your Archive task. To ensure this, select the "Scheme" pop-up menu in the upper-left corner of the Xcode Toolbar, and choose "Edit Scheme". Select the "Archive" task and make sure the Build Configuration is "Release".
To check that your app is signed with the correct distribution profile, use the steps in section How do I check which certificate was used to sign my app? and ensure the Authority is "iPhone Distribution". If it is not, continue to next bulleted items to correct the responsible configuration.
Ensure that the appropriate distribution provisioning profile that you created for this application on the iOS Portal site is assigned to the Release build configuration. To ensure that use the steps in section Assigning Provisioning Profiles to Build Configurations.
Next, ensure that you are choosing the correct distribution provisioning profile when distributing your app on the Xcode Organizer > Archives tab. To do that, use the sections linked below depending on your distribution method and take special note you're selecting the correct profile on the "Identity" field (Xcode 4-4.2) or "Code Signing Identity" field (Xcode 4.3+) after clicking Submit/Share/Validate or Distribute on the Xcode Organizer > Archives tab.
https://developer.apple.com/legacy/library/technotes/tn2250/_index.html#//apple_ref/doc/uid/DTS40009933-CH1-TNTAG32

a valid signing identity not be found?

I am trying to create a distribution build with mono for days already... I got the distribution provisioning profile and the distribution certificate from our "team agent" and drag-dropped seperately onto xcode-organizer and keychain-access, but still, there's the warning message showing :
"A valid signing identity matching this profile could not be found in your keychain."
and I couldn't make the distribution build still. Any idea which step I made it wrong? Please advice; much appreciated!
Thanks,
ab.yyang
It sounds like you only have the provision file and the certificate from Apple, but not the original private key used to request the certificate.
If that's the case, you either have to ask whoever created it for a copy of private key, or you'll need to generate entirely new keys, request a new certificate and create a new provision file.
open Keychain Access
erase everything in 'Keys' and 'Certificates'
open Xcode and erase all provisioning data
goto Provisioning Portal and revoke your certificate
create a new one, and use launch assistant
If this happen after renewing the DEVELOPER CERTIFICATE,
my fix to the problem was going to the apple provision profile, modify the development provision and checkbox the certificate.(suppose to be empty checkbox near the certificate name).
then, you can : download and install the provision manually by dragging to xcode
or going to Organizer-Library(on the left)-Provision Profiles, and click the "refresh" button(in the bottom of screen), this will download the new provision profile that "connected" to the new CERTIFICATE and the warning will disappear.
If you are building to run on a physical device, you need to be enrolled in the iOS Developer Program. From there you go to the Developer Portal to generate a Provisioning Profile. That profile gets loaded to Xcode via the Organizer window.
Have you done those steps?

Multiple Certificates/Provisioning Profiles in one Xcode organizer?

There are several similar questions here, but none could answer my basic question:
Is it possible to have two separate developer certificates in the keychain and two corresponding distribution profiles in Organizer?
I have my own (working) developer certificate and provisioning profile for my own iPhone apps.
Now I finished a project for a client and would like to use his developer account/certificates/provisioning profiles to submit his app to the app store on his account.
Is that even possible?
So far I downloaded and installed his certificates and they show up in my keychain, and I installed his provisioning profile in Organizer, but Organizer tells me "A valid signing identity matching this profile could not be found in your keychain.".
Likewise, the archive build fails.
I couldn't find a way to tell Organizer to use the certificate of my client instead of my own-I think this is the problem.
Thanks for any help!
Yes I've produced app store builds of projects for clients several times using their distribution certificate. No need to use their developer certificate. There are many things can could go wrong here, if you have access to the client's account you can go on to the provisioning portal and check things out:
make sure the bundle ID in the project settings exactly matches the app ID on the iOS provisioning portal (com.company.appname usually)
make sure the app store distribution provisioning profile is marked as "valid" and shows up under the distribution certificate.
make sure the app store build config in xcode references the client's distribution cert.
open your keychain and make sure that the client distribution cert also has its accompanying private key. This may be the problem, it's the part usually left out. The client must export his private key for his dist cert and send it to you in the .p12 file along with the password to the .p12 file. The dist cert can't be used to sign the app without the private key!
sometimes just quitting Xcode and restarting it helps.
See this solution to duplicate certificates: http://tapadoo.com/2012/certificates-magically-re-appearing-in-your-keychain-try-this/
The gist is that if you have an old private key and provisioning profile around, you can run into a case where Xcode will re-create an old certificate in your keychain. This will make code signing gag because it requires a single certificate with a given name. Deleting the old private key will resolve this issue.
EASY MODE
(I hate these archaic export errors so bad. So many hours wasted. I'm not religious but I still pray this helps you)
Log into https://developer.apple.com
go to Certificates, Identifiers & Profiles
bottom left: Provisioning Profiles
Delete any duplicates / invalid profiles (in my case I only had one but it was invalid)
Note: if you're trying to export an archive, you can leave the export window open, delete a provisioning profile, then click "retry" or whatever the button says. This will save you from have to re-archive over and over
#xcode8.2.1 #osx10.11.6

Codesign verification failed in Xcode for iphone app distribution

I am trying to prepare my app for distribution to the app store and am getting the following warning in Xcode which is causing an error in ApplicationLoader. I know this is a common problem from searching but I have yet to find a proper solution? I went thru Apple's steps for distribution on the iOS provisioning portal and still get this error.
My distribution profile is set on my Target.
"Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)"
Any suggestions?
1) Check for the scheme in 4.2
2) make sure you have selected the release scheme
3) make sure you have selected the distribution profile
4) build for archiving .
App distribution certificate is only used for the app store. You will get this error if you try and put an app signed with your distribution certificate on your phone -- it simply won't work.
Do you have a valid iPhone Distribution certificate in your Keychain?
Does the Xcode Organizer Provisioning Profile window show your Distribution provision?
Does your distribution provisioning profile have an app ID that is the same or compatible (wildcard) with the Identifier setting in your Target Info Properties setting?
Edit: added:
Do you have exactly one iPhone Distribution certificate in your Keychain?
Did you do a Build Clean in Xcode before your distribution build? (or rm -rf ./build)
First of all, check your Certificate, is it distribution or developer? And it must be Distribution certificate.
Follow these steps:
clean all certificate from your keychain and download new distribution certificate.
Also clean remove the distribution provisioning profile what you use for the particular for your this application and re download that one. after that must be clean build in Xcode and after that in project setting you must be select the particular D.P.P. for your application and go a head just only build it. then you get the particular build.
Regarding the D.P.P you must be clear what type of profile you create for this. it must be Appstore D.P.P.
I hope it should be helpful for you.
I had a similar problem. For me it turns out that I didn't download the "distribution" provisioning file (note the emphasis on the "distribution"). Once I got that, everything worked. I'm almost certain that that's what your problem is ;)
cheers,
Matt

iPhone provisioning profile problem

My iPhone application runs fine in the simulator. I'm trying to deploy it onto a physical iPhone. When I install the provisioning profile, my Organizer says "A signing identity matching this profile could not be found in your keychain."
I can't resolve this. What do I do?
A) Did you create a provisioning profile in the iPhone development portal?
B) If so, does the name in the info.plist file match the appID you created in the portal and used to create that development profile (that is, if you had created an app id of "com.fredsgreatstuff.*" in the info.plist you'd replace "com.mycompany" with "com.fredsgreatstuff")
C) Did you set PRODUCT_NAME in the project settings for all targets (to something like "mygreatapp")
From the look of the error though you must have got the development cert wrong, or not downloaded the certificate from the portal generated after you uploaded your developer signing request.
The portal has pretty good instructions at this point (that didn't used to be the case), be very careful to follow every step to the letter.
Make sure you've downloaded your certificate from the program portal. Double-click on it to create a private-public key pair in Keychain Access. The private key will be created when you download the cert and double-click on it.
If it does not, you might have to delete the certificate and create a new one. Make sure the in the certificate signing request you create, your name is exactly as you've mentioned in the portal.
Here is a really good website with a checklist on troubleshooting code signing errors:
http://www.drobnik.com/touch/2009/05/how-to-fix-code-signing-errors/
Most of its content is covered by the posts above, but it is easier to work through.
FTR, I hit the same problem that Genericrich pointed out - my Development Profile didn't have the private key, but my Distribution one did. As a workaround I just defined my Debug build to also use the Development Profile.
Make sure you have your developer certificate installed on the machine, AND that your private key installed with it. You can check this in the Keychain Access tool in your Utilities folder. The cert should expand to a private key icon with your name on it.
It might be that the "keychain" into which you installed your certificate is not currently set as your "default keychain". I had the same (or very similar problems) when my default keychain was somehow switched to a different default.
Open Keychain Access (Applications -> Utilities -> Keychain Access)
On the top left list box called "Keychains" make sure the keychain into which you installed your developer certificate (usually "login") is still bold (ie: set to the default keychain).
You can set the default keychain by right (or control) clicking on the keychain you want ("login" for example) and selecting the "Make Keychain 'xxx' Default".
Cheers.
I had the same problem with Xcode 4.0 on SL.
In the Organizer window, doing a "drag and drop" of the provisioning profile always gives a "Valid signing identity not found".
You have to use the + (add) icon and search for your provisioning profile file to upload it on your device. It just worked for me (no need to reinstall all the stuff).
Deleting all expired provisioning profiles in Xcode organizer did the trick for me. After this I clicked on the Refresh button in the organizer and the provisioning profiles have been downloaded automatically.