Doesn't include signing certificate in xcode8.1 - ios10

it is working fine in xcode7.2 on same machine. here I am not using automatic code signing. when i select Provisioning profile tab manually it shows error Provisioning profile doesn't include signing certificate.Also Removed provising profile,certificate from machine and redownload still it's not working and also remove derived data from xcode.but results are same.

Related

Change Signing Certificate in Xcode 8 Beta 2

I have two certificates in my keychain that I use for code signing.
One is my team’s production certificate that I use for signing apps for enterprise distribution.
The other is my development certificate (part of the same team) that I use for signing apps for development.
In Xcode 8 I have deselected ‘Automatically manage signing’ and now my certificate has been set to the production certificate associated with my team, which now only allows me to sign distribution apps. I am able to change the Provisioning Profile to a development one, but then I get an error that “Provisioning profile “Development-Profile" doesn't include signing certificate “Production-Certificate”. But Xcode 8 does not allow me to change my Certificate manually.
How can I change between code signing identities within the same team in Xcode 8?
Well I immediately found the answer to my own question, of course.
I assumed the old Code Signing/Provisioning Profile sections from Build Settings had been removed and replaced completely by the Signing section of the General tab in Xcode.
In fact they are still there and you can use them as usual.
Thought I'd answer my own question instead of deleting for everyone else who might have assumed the same!
There are 2 ways to sign application in xcode8
Automatic signing -- Managed by xcode, no need to worry but this is for development signing.
Manual signing: This means "uncheck auto sign option in General tab"
This leads to introduction of two more sections related to signing in xcode IDE.
Debug and Release configuration, here you need to specify the profile you intended to use for building your application. Here you can specify the development/distribution profile. Offcourse this is also available in the Build settings section.
In General tab you cant change code signing identity.
Using xcconfig file you can override the code signing identity.
You are correct, here we don't have option to set the codesigning identity. Using xcconfig file you can override the code signing identity.
PROVISIONING_PROFILE_SPECIFIER = TEAM ID/PROFILE NAME
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution
CODE_SIGN_IDENTITY[sdk=watchos*] = iPhone Distribution

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

Cannot create correct ad hoc build of app

I am trying to distribute my application to a beta tester. I believe that I have followed the ad hoc distribution process to a T but I my tester is having issues when trying to install. The error being "Could not install, invalid entitlements" or something to that effect. I have generated a distribution certificate. I have generated a ad hoc provisioning certificate referencing my distribution certificate, my app id, it's marked as an ad hoc distribution and the devices are selected (I regenerated just to be sure). I downloaded the certificate and profile and installed in Xcode and the keychain as needed. My app id in the info.plist is the same as the one in the profile (with the exception of the 10 character Apple generated prefix).
I went to Xcode and created a dist.plist and unchecked the get task allowed value. I created an Ad hoc distribution configuration and set the code signing identity to the one I just down loaded. Build clean. Build and archive. Shared it using Organizer. Emailed the .IPA and the mobileprovision file to the beta tester. It is probably a forest for the trees type of thing.
And that's where my tragic story ends. I've read everything I can find and I appear to be following the steps. Obviously I am missing something.
is the 'Application requires iPhone environment' checked in your info.plist?
are you sure you are using correct provision profile?
Make sure all the steps you entered has performed correctly, as you already mentioned forest of trees.
One thing you are missing is to set the
Code signing entitlements in you project's settings
you have to set its value to your entitlements file name as in your case dist.plist
so set Code signing entitlements = dist.plist in your projects settings.
Wish you good luck!

Apple's Problematic Provisioning Portal

I have restarted this process about 4 times over the past 3 weeks. I have not succeeded in submitting my app to the store. Please help me! I just started over again tonight, I did it in this order:
Deleted everything referring to the IPhone in my Keychain,
Redownloaded the Distribution Certificate
Created a new app id called: com.myapp
Downloaded the Provision Profile and installed it into XCode.
Please note: I did not install an Entitlements.plist because I was told I didn't need one. Everything is looking good at this point.
Duplicated my "Release" Configuration and renamed "Distribution"
Under the Configuration of "Distribution", Code Signing Identity, I can see my Provision Profile it actually says: IPhone Distribution: My Name (for Application Identifiers: com.myapp)
So at this point at the bottom of the Project Info Window I see this:
The name (“common name”) of a valid code-signing certificate in a keychain within your keychain path. A missing or invalid certificate will cause a build error. [CODE_SIGN_IDENTITY]
So I realize I haven't altered my bundle name for my app, I change it to com.myapp, warning still doesn't go away. I tried adding in my prefix into the Bundle Identifier like this:
5JSF8843kJJ.com.myapp (for example)
But the error still doesn't go away!
After all this I try to Build and Run on my device anyway thinking it may go away. But I get this error:
The iPod “myIpod” doesn’t have the provisioning profile with which the application was signed.
Click “Install and Run” to install the provisioning profile “myprofile” on “myIpod” and continue running “myappname.app”.
Please Help! I need to get this to work!
Thank you for your time.
UPDATE: I have fully tested the app and I am ready to distribute, I am trying to get a successful Build so that I can zip up my .app file and submit it using Application Loader.
You can't run an app using the Distribution certificate or Distribution Build.
You shouldn't duplicate your Release Build until after you get it running and configured exactly as needed, except for the choice of code signing certificate.

iPhone Distribution: No profiles currently match

I am about to upload an app to iTunes Connect. I am not Team Agent, nor does it seem the Team Agent can make me a Team Agent. So he logged onto Member Center and downloaded a Distribution Certificate, which is in my Keychain along with the WWDR Certificate.
The bundle identifier is set to se."companyname"."appname".
When I set the Code signing identity to Distribution, it says no profiles match. Can only the Team Agent build the final apps for upload? How do I make XCode "use the right set of profiles"?
Any idea on how to get past this last hurdle? :)
Edit: can the Team Agent log onto Member Center and create a provisioning profile for the app, will that solve everything?
Answer: See Paul Peeleen's answer, I decided to add this additional information (too long for comment).
Paul, I'm going to mark yours as the correct answer, because it set me on the correct track... certificates are for the keychain (which is usually linked to a computer, or rather, a computer user's login, I guess).
A quite separate distribution profile must be created for the app - modifying an existing Development certificate to include the Team Agent only lets him develop. The little 'a-ha' or perhaps 'd'oh' moment was that it has to be created in the Provision section with Distribution tab selected (in the provisioning portal).
After that, in the Target Info/Build tab you just use the default automatic profile selector (dev/distro) and it's found automatically.
I also temporarily tried adding the 'gibberish' (f.ex. JX567ERNB.) before the se.companyname.appname for the Bundle Identifier, but the automatic profile selector told me that it shouldn't be there, I removed it and it worked!
The profiles are what enable the projects to use certificates in the Keychain, I guess.
"iPhone distribution no profiles match" is one of the most annoying issue that I have ever had with app development.
This is how I sorted it out:
In Developer under iOS Provisioning Portal I needed to generate 4 certificates and download the WWDR intermediate certificate to be able to submit my app to the App Store:
Under Developer Certificate section (link) generate a Developer Certificate. Also Make sure that you have the WWDR intermediate certificate installed, if in doubt download it from there.
Under Developer Certificate section (link) generate a Distribution Certificate (This is not that will show up in Xcode!)
Under Provisioning section (link) generate a Development Provisioning profile certificate
Under Provisioning section (link) generate a Distribution Provisioning profile. THIS WILL SHOW UP IN XCODE AS A DISTRIBUTION CERTIFICATE!
After that I was able to select the iPhone distribution profile generated at 4. Also make sure that your target settings are correct as they overwrite the project settings.
Your active provisioning profiles are listed under "Xcode/Organizer/Library/Provisioning Profiles"
I hope it helps
UPDATE: Some distribution provisioning profiles often just "disappear" from my list. So I have to download and install (just double click) them again from https://developer.apple.com/ios/manage/provisioningprofiles/viewDistributionProfiles.action not a big deal, but annoying.
I checked this with my accounts and it seems that only the team agent can create the stuff needed for AppStore or AdHoc releases.
IF you have the correct provisioning profile installed, and both your project settings and target setting for the "release" build are set to the correct provisioning profile. + that you have the correct certificates installed for that computer... you can build the release.
I am unsure if only the Team Agent can upload these build, but otherwise you can package the release as a zip file (which you should anyways) and send it off the the team agent. The Team agent can then use the Application Loader to upload the application.
Also dont forget If you deleted all your certificates and keys in Keychain and you plan on regenerating those certificates make sure you change your certificate preferences in Keychain for Online Certificate Status Protocol to Off and Certificate Revocation List to Off, for some resaon this important step is the only way it worked for me.
Another reason developer profiles are missing
While in organizer under Library > Provisioning Profiles...
On my computer, if I hit Refresh, all the Distribution profiles are removed!!!
No big deal, just go back to your provisioning portal and go to Provisioning > Distribution and download the appropriate distribution profiles and your good to go! :)
Instructions right from apple... Follow them EXACT
https://developer.apple.com/ios/manage/certificates/team/howto.action
To request an iOS Development Certificate, you first need to generate
a Certificate Signing Request (CSR) utilizing the Keychain Access
application in Mac OS X Leopard. The creation of a CSR will prompt
Keychain Access to simultaneously generate your public and private key
pair establishing your iOS Developer identity. Your private key is
stored in the login Keychain by default and can be viewed in the
Keychain Access application under the ‘Keys’ category. To generate a
CSR:
In your Applications folder, open the Utilities folder and launch
Keychain Access. In the Preferences menu, set Online Certificate
Status Protocol (OSCP) and Certificate Revocation List (CRL) to “Off”.
Choose Keychain Access -> Certificate Assistant -> Request a
Certificate from a Certificate Authority. Note: If you have a
noncompliant private key highlighted in the Keychain during this
process, the resulting Certificate Request will not be accepted by the
Provisioning Portal. Confirm that you are selecting “Request a
Certificate From a Certificate Authority...” and not selecting
“Request a Certificate From a Certificate Authority with …”
In the User Email Address field, enter your email address. Please
ensure that the email address entered matches the information that was
submitted when you registered as an iOS Developer. In the Common Name
field enter your name. Please ensure that the name entered matches the
information that was submitted when you registered as an iOS
Developer. No CA (Certificate Authority) Email Address is required.
The ‘Required’ message will be removed after completing the following
step. Select the ‘Saved to Disk’ radio button and if prompted, select
‘Let me specify key pair information’ and click ‘Continue’.
If ‘Let me specify key pair’ was selected, specify a file name and
click ‘Save’. In the following screen select ‘2048 bits’ for the Key
Size and ‘RSA’ for the Algorithm. Click ‘Continue’.
The Certificate Assistant will create a CSR file on your desktop.
I battled the problem all day too. Tried Tons of things.
I downloaded the distribution provisioning profile. OK
Double Click. Into Keychain it goes (like magic) OK
Build. NOPE. Not Signed
Check - it is not the Team Provisioning Cert that you are looking for it is the plain looking one that cannot be installed on devices.
If it is not there you did not copy it to YOUR library/MobileDevice/Provisioning Profiles folder. (just like I didn't)
Make sure that the case of your bundle identifier in the provisioning profile and your info.plist are the same.
I just had this problem, and resolved it finally when I saw that Xcode would not even let me manually select my distribution profile, saying 'profile doesn't match bundle identifier myappname'
When a took a close look, I saw that the bundle name had the app name capitalized, and the provisioning profile had the appname in all lowercase.