Xcode 6 error when building app for release - ios

I am having issues trying to achieve or even build a release build of an app I am working on. Whenever I try to build the app for release I get an error saying:
No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) were found.
I have the cert for this profile on my computer but in the Developer Portal I only have a certificate for development. Is this causing this error to occur? Do I need to have a Distribution cert to be able to build for release? Any help would be appreciated.
Note: I am a developer(team member) for a company so I do not have direct access to the Apple Developer Portal.

I know provisioning profiles are a pain :) This is what I do to stay organize and develop/distribute my projects:
The developer portal (not xcode) contains the most accurate source of profiles. For example, imagine you created a merchant certificate, turned on apple pay, and then generated a provisioning profile. Then let's say you decide you no longer want to use apple pay - the act of turning it off actually invalidates the provisioning profile. You will see a yellow "invalid" warning in the developer portal, but the provisioning profile may still be available in xcode! Really annoying. So I would always make sure that your provisioning profile is valid in the developer profile before distributing an app.
In the developer portal, always make sure you have two distribution profiles -- one ad hoc to use with testflight, and one to distribute to the apple store. You should also have one developer profile to build and debug your code.
Once you have your profiles set up, go into xcode and refresh the provisioning profiles as described here: https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html#//apple_ref/doc/uid/TP40012582-CH30-SW26. I.e. go to preferences, accounts, view details..., and click the refresh button on the bottom left hand corner.
Now that xcode's provisioning profiles are updated, you need to now code sign with the right profiles. To do so, go into your project settings, and go into build settings for both the project and the target. Under debug, select your iOS development certificate. Under release, select your iOS distribution certificate. Under provisioning profile, you will want to select your development profile just to build on your device and debug, your ad hoc distribution profile if you want to archive the project and send it via testflight, or your apple store distribution profile if you want to archive the project and submit it to the apple store.
A few things to note, is that when you are creating the provisioning profiles, you need to specify the certificate you are dealing with. So if you are creating one of the two distribution profiles, you will need to select your iOS distribution certificate. And when you select ad hoc distribution, will need to select the devices that you want to be able to distribute too. Testflight will help you register the devices that you want to distribute to, and once registered, you will be able to select those devices to add them to the provisioning profile. If the certificate you select in xcode was not used to generate the provisioning profile you selected in xcode, then you will probably get the error you mentioned. Think of the provisioning profile as the link from you as a developer (i.e. your certificate) and/or your devices to your app id (i.e. your project).

Related

Manually create provisioning profile in Xcode

I have a simple goal I would like to achieve, manually create a provisioning profile in Xcode.
So, I was trying to use the Pythonista Template in Xcode, and I wanted to flash it to one of my devices so that I could test it on a real device and not just the iOS simulator.
So I enter in what I want the app ID to be, and it says, No profiles for 'com.cartercoding.getnpostserver' were found. So I need to manually create a provisioning profile for it, which I have looked up, but the answers I have found are not relevant.
I am using Xcode 11, stable release.
I don't really know what a provisioning profile does...
A provisioning profile grants permission for one or more iOS devices to run an app signed with a specific certificate. Normally, an iOS device will only run apps that are signed by Apple; a provisioning profile tells the device that it may also run apps signed with a key corresponding to the certificate specified in the profile.
I am trying to put an app that I downloaded from the internet on my phone, so I can't do it the usual way.
The whole iOS code signing infrastructure is designed to prevent you from doing that. Short of jailbreaking your device (which is a whole other conversation) you can't just install an app that you've downloaded onto your phone.
I have a simple goal I would like to achieve, manually create a provisioning profile in Xcode.
You can't create a provisioning profile "manually," if by that you mean to construct one on your own; you have to get one from Apple (whether that's automatically through Xcode or via the developer portal).
For users who need to manually create a provisioning profile (in some companies every app has to have its own provisioning profile)
Sign in to your Apple Developer account and navigate to Certificates, IDs & Profiles > Identifiers > Provisioning Profiles.
https://developer.apple.com/account/ios/profile/production
Add a new provisioning profile.
Activate App Store.
Click Continue.
From the dropdown menu, select the app ID you just created.
Click Continue.
Select the certificate you just created.
Click Continue.
Fill in a name of your choice. The name is not visible to end users.
Click Generate.
Download the provisioning profile.
Click Done.
The provisioning profiles overview with your new provisioning profile is displayed.
If you need a Provisioning Profile of Type Ad Hoc
Is everything the same except point 3
These instructions were copied from this page
https://support.staffbase.com/hc/en-us/articles/115003598691-Creating-the-iOS-Provisioning-Profiles

What is the Team Provisioning I have from scratch?

I understand the provisioning profiles something like this: a provisioning profile contains signing identity information, and used to sign an application code. I can develop an application using simulators without any provisioning profiles. To run and test an application on real devices, I need at least development provisioning profile. These profiles should be generated in Apple Developer Portal and then downloaded to use them locally with Xcode. Currently Xcode itself is responsible for generating and downloading profiles, and Xcode does it automatically. There are also distribution provisioning profiles Ad-Hoc and AppStore.
But I'm confused by so-called "Team Provisioning Profile" used to sign the application in Xcode by default. It appears automatically and allows me to install application on the real devices, so I understand it as an automatically generated development provisioning profile. But I can't see any corresponding iOS-development provisioning profile in the Apple Developer console.
My question is: What is the Team Provisioning Profile then? If it's kind of Development Provisioning, why can't I see it on Apple Developer console?
Team : - A kind of Development profile that’s managed by Xcode. Xcode automatically adds everyone’s cert to it and all UDIDs from devices as well.
What is the Team Provisioning Profile then?
To save you time, Xcode creates and manages a type of development provisioning profile, called a team provisioning profile, for you. The team provisioning profile allows all your apps to be signed and run by all team members on all your team’s devices. For an individual, the team provisioning profile allows all your apps to run on all your devices. Xcode also performs configuration steps for each app service you enable that requires some type of provisioning. Although Xcode simplifies this process, it helps to understand your code signing and provisioning assets and to know where they reside.
If it's kind of Development Provisioning, why can't I see it on Apple Developer console?
Xcode creates a team provisioning profile and its components as needed in your developer account. Xcode requests a development certificate for you if it’s missing. The development certificate is used in the team provisioning profile to identify you. A device must be registered to create a provisioning profile, so Xcode may ask you to connect an iOS or tvOS device. For Mac apps, Xcode automatically registers the Mac that is running Xcode.that's why you can't see it on Apple Developer console
More check this : apple doc

iOS Distribution Provisioning Profile invalidates itself when new devices are added

I've got a Distribution Provisioning Profile I use for distributing my application to QA testers via AdHoc builds / HockeyApp. I'm also part of a team of other developers working on other apps, and they have their own QA teams.
Whenever someone else adds a device to the Apple Developer Member Center (previously the "Provisioning Portal") located at https://developer.apple.com/membercenter/index.action , the Distribution Provisioning Profile becomes Invalid.
To make the profile valid again, I must open up the profile and include all of the newly added devices in the profile, then re-download it.
This is all fine, but it seems unnecessary. My Distribution Provisioning Profile should only need the devices of my app's testers linked to it, not the devices others have added for their own testing purposes.
Does anyone have any information / links to documentation on why this happens (searches only seem to bring up the common issues with provisioning profiles in general that people always run into when starting out), and whether or not there is a way to get around it?
Thanks,
- Adam

Error Code-90161 Invalid provisioning profile

ERROR ITMS-90161:"Invalid Provisioning Profile
I have created IPA using Xamarin IOS in ad-hoc mode and selected a adhoc provisioning profile. but while uploading, following error annoying me :(
when I uploaded using application loader:
ERROR ITMS-90161:"Invalid Provisioning Profile.The provisioning profile included in the bundle x.x.x.x[Payload/x.x.x.app] is invalid.[Missing code-signing certificate.] For more information,visit the iOS developer Portal."
If you get this error, you probably don't have the correct type of Provisioning Profile. There's a few types of Provisioning Profiles, most notably are the "Development" and "Distribution" profiles. I suggest looking at your provisioning profiles, and if necessary recreate them.
To elaborate: You have 1 Certificate (created via Xcode Certificate Generating). With this Certificate, you can create an "App Identifier", and Provisioning Profiles. You can use the same Certificate for both a Developer Provisioning Profile and a Distribution Provisioning Profile. They don't work with one another, meaning a Developer Provisioning Profile won't work for a release build, and a Distribution Provisioning Profile won't work for a debugg build.
Try this, and see if that helps. Be sure to haul the new profiles in Xcode (or any other method you'd use) and edit your project's settings.
Good luck!
Love and regards,
Björn
My issue was related to having Xcode Automatically manage signing. What finally fixed the issue for me was going into the developer portal, selecting Certificates, and revoking the Distribution Managed certificate. I then rebuilt my project in Xcode, keeping the checkmark enabled to Automatically manage signing, and a new Distribution Managed certificate was automatically created in the developer portal under certificates. Distributing the archive to the App Store no longer produced any errors.
This issue also came up in other projects where I manually manage the Provisioning Profile. What worked for me was doing the following on the developer.apple.com portal:
Revoke the existing Distribution Certificate linked to the app's provisioning profile.
Issue a new Apple Distribution Certificate.
Link the new certificate to the app's provisioning profile.
Make sure to select the correct provisioning profile for your app's target in Xcode.
While de3z1e's solution seems to work for most people, it did not work for me. What did work was creating an Apple Distribution cert when using XCode settings. While Xcode is open,
Go to preferences (Command + ,) -> Accounts -> Choose your team -> Manage certificates -> + (bottom left) -> Apple Distribution -> Re-archive + upload
I am not sure why the other solution did not work for me, but this did. I also have Xcode manual signing on and left it on.
For Distribution:
If you upload to Test Flight you need an Apple Store provisioning Profile.
If you are distributing to specific devices, you need Ad hoc provisioning profile.
You assign it in visual studio through Manual Provisioning, choosing an Apple Distribution Identity, and choosing your provisioning profile manualy - nothing in automatic.
If you like me could not find your newly created provisioning profile to appear in visual studio, make sure the bundile indetifier in info.plist is the same as used in the provisioning profile.
If you are white-labeling as per xam-girls blog, other copies of info.plist is not looked at by visual studio iOS Bundle Signing
I faced same problem. I edited profiles, it works.
Click edit button all provisioning profiles and save it. Download and use edited profiles. App will upload to store.

Xcode 5 crashing when trying to validate archives

I had a couple questions when trying to put an app on the app store.
1) With Xcode 5 when trying to validate the archived project, Xcode 5 keeps crashing when trying to download the provisioning profile from the net. I have refreshed the provisioning profiles using the Preferences >> Accounts >> View Details and have clicked the refresh button but it still crashes when I try to validate.
2) Is it best practice to have a separate distribution certificates and provisioning profiles for each app you put on the app store? right now I have a separate provision profile for my apps but they are under one certificate. Can you guys tell me what the best practice is?
3) And can you try to explain what the certificates and the provision profiles are doing? Also, what would the difference between distribution provision profiles and development provisioning profiles.
1) - Check what version of Xcode you're running. I had a similar issue where I was running a developer preview - you can't submit an app from a DP version of Xcode, and mine was crashing at the exact same point as yours.
2) - Having 2 certificates - 1 for dev, 1 for distribution seems to be the norm. I would suggest that you use explicit app ids and not the wildcard ID when you go to create your App ID though.
3) The way I see it, Provisioning profiles are your wrappers for your different things that make it up - mainly the signing certificate, the app id and the device id(s) - You select either a distribution or a dev signing certificate to determine if the app is being developed or submitted to the app store. You select the App ID to tell the app what functions it will have (iCloud, Data protection, etc) and what teams can work on the app. The Devices are what UDIDs are authorised to run this app that has this associated provisioning profile. The provisioning profile is how it's all packaged up.
As another way to look at it, You have your .ipa file (your app) and your provisioning profile. The device looks at the profile, checks if the devices UDID is present in the provisioning profile, checks the App ID to see what features it's allowed to run, and the certificate is used to sign it all off.
Hope this helps.

Resources