Failing with valid code signing identity, Xcode - ios

I intend to release an update for my iOS app Oskarshamnsliv to AppStore, but fail when I try. Since I last released an update I have bought a new computer, which most probably is the cause of my problems.
I have never before really understood what I have been doing when releasing and updating my apps. I have just used Ray Wenderlich's guides here and here. As I try to do the same again, Xcode gives me an error message when I choose Product/Archive.
Even though I press "Fix issue", the issue is not fixed. Anyway, I am sure the problem has something to do with with certificates/provisioning profiles which is further proved by the error description I get from Xcode:
I have tried all sorts of things, and in despair I have also created new and deleted old certificates and provisioning profiles. I have put some screenshots together to help make a clear picture of my situation. I have spent too many hours on this now, any help will be much appreciated!
From build settings of my app:
From my Xcode organizer:
From my page on developer.apple.com:
From my page on developer.apple.com:
From my Keychain Access:

First, i suggest you go to preferences panel on Xcode under Accounts tab, click on 'View Details...' buttons under your account details, and click on the refresh button to make sure you have the most up to date profiles on your account.
Second, i see that under Code Signing in your project settings, the 'Release' settings has different profiles set there under 'Any iOS SDK'.

Related

IOS: Code signing error Xcode 6.3.1 [duplicate]

I've build a new application which is going to support IOS 7. I got the new XCode 5 GM and tried to sign my apps using my fresh provisioning profile and distribution certificate, but i'm having trouble with distribution. I constantly get the following error:
"Invalid Code Signing Entitlements. The entitlements in your app
bundle signature do not match the ones that are contained in the
provisioning profile. According to the provisioning profile, the
bundle contains a key value that is not allowed:
'[XXXX.com.sample.company ]' for the key 'keychain-access-groups".
Also the same error for a key value called application-identifier.
Screenshot of the errror:
The solution lies in the new option in Xcode 5 which says provisioning profile. Just set the project target's provisioning profile to the right one and it'll work.
If you are like me and you think you tried EVERYTHING, archived your project over ten times, banged your head on the keyboard and still get this error. Please do yourself a favor and simply Restart XCode, it worked for me. Sometime Apple... I hate you.
I went through many of the steps above but what finally worked for me was refreshing my profiles in Xcode. Not sure why it was necessary since my app's distribution profile was showing up in the list already. Here are the steps:
Xcode Preferences
Accounts tab
Select your Apple ID
Hit the View Details button in the Apple ID detail panel
Hit the Refresh button in the lower left corner
In my case, i activated the same capabilities in Xcode that in Application services in developer.apple.com. Thats works for me
In my case (sorry) I switched "Team" to "None" in -> General -> Identity
In another case I needed to switch this identity from "None" to the developer account managing the identities and profiles.
Xcode sometimes messes up greatly with code signing, it seems. Or, we mere mortals simply aren't clever enough to understand what it is doing, of course. Don't give up, we're all going through some code signing torture at times!
In my case, I had to set correct Provision Profile for Release, and then had to restart Xcode. Before restarting, it had same provision profile, and didn't work. So, sometimes a restart can do miracles. Maybe this helps somebody.
If someone uses a GameCenter then check this section in your target. I worked with some old project and there were 2 errors (but everything worked fine). Disabling and enabling it back solved this problem.
Most likely this action adds Game Center entitlement to App ID and and handle it itself.
1.Go to project folder, delete *.entitlements files.
2.Then go yo in xcode project target -> build settings -> code signing entitlements - delete values
3.Clean
4.Run
Ah, this glorious error. For me whenever I see this error I check the following things:
1. Allow XCode to access your provisioning profile info all the time - If XCode keeps asking when you start it up to have access to your computer's private files so that it can get provisioning profile information with the options to allow access always, not now, or just one time - set it to ALWAYS ALLOW access
2. If you have any old entitlement files kicking around your project get rid of them and any sign of them - if you see a .entitlements file in your project delete it (or at least remove the reference to it if you aren't sure you are ready to outright delete it), then make sure the 'Code Signing Entitlements' line under the 'Code Signing' section in Build Settings is empty
3. Check your Application Services online and match them up with your Services in XCode for the app - Go to the Apple Member Center and check the App ID for your app, click on the app to see its 'Application Services' and see what you have checked, then go to XCode and check your 'Capabilities' section to make sure the two have the same list of Apple services on both
4. Make sure you assign a valid Provisioning Profile to your app before validating - double check your provisioning profile for your app in the Apple Member Center, make sure it isn't expired, has the right App ID with the correct bundle id and distribution. Download and click on the new provisioning profile to make sure XCode has it, or go to XCode > Preferences > Accounts > click on your account and 'View Details' then click the bottom corner button to Sync all the profiles to XCode. You should have the profile available to select now in the 'Code Signing' section. Once you have the correct provisioning profile then you can set the 'Code Signing Identity' lines to the correct option for that provisioning profile.
Note - if doing a distribution certificate it can help to set all the 'Code Signing Identity' lines to the identity you use for distribution including the debug lines
5. IF ALL ELSE FAILS - Clean your project and Restart XCode and some Apple magic may just work fine the next time you open your project and try to Validate
If you're building an old 3.1.5 project, Xcode 5 has some bugs which unfortunately makes Benjamin's answer impossible, as there are no Provisioning profiles to pick from. After many a late hour of tormented reading of Xcode project files I came up with this solution that worked for me:
In the Utilities pane (to the right) in Xcode 5, under project Document, change from Xcode 3.1-compatible to Xcode 3.2 compatible.
Enter your organization name.
Close project.
Open your project file, e.g. open -a TextEdit path/to/name.xcodeproj/project.pbxproj
Remove the two Distribution clauses (isa=XCBuildConfiguration).
Remove the two accompanying lines in buildConfiguration (one in PBXNativeTarget and one in PBXProject XCConfigurationLists)
Now you're ready to re-open, archive and submit to App store - voilà! It works again!
How I think it works
I assume this works because Apple somewhere along the line decided to drop the need for any separate distribution config, which is a good thing. When I archive, Xcode automatically code signs for distribution. That's the way it should have been implemented in the first place, it's just a shame that Apple can't make auto-migration part of the IDE; instead they force us developers to spend man-decades to make this stuff work.
I have been struggling with this problem for more than a day now, trying all kinds of solutions suggested here and elsewhere on the internet. Nothing worked...
But, I finally managed to solve the problem!
The problem I had was with an old app that I haven't touched in over 3 years, and now I was about to release a long awaited update. Since the time I released the app, Apple has been updating how the certificates and App Id works. They have introduced the concept of Team Id which seems to be recommended to use.
In particular, the Apple's "Certificates, Identifiers & Profiles" site, has seen a lot of changes since then.
There I realized that the Provisioning Profile I was using for App Store Distribution were connected to the App Id ED8xxxxxxx.com.rostsolutions.* but looking at the App Id for the game I was about to submit I notice that the App Id was ATMxxxxxxx.com.rostsolutions.Swisch. So the App Id prefix did not match!
That seemed to be the root of the problem. So what I did was to create a new Provisioning Profile connected to the App Id ATMxxxxxxx.com.rostsolutions.Swisch instead. Using that Provisioning Profile I successfully submitted my app to App Store and now I just keep my fingers crossed that everything else works fine at Apple's side.
(I first tried to connect to new Provisioning profile to the wildcard Id ATMxxxxxxx.com.rostsolutions.* instead, but that didn't seem to work).
But what puzzles me is that when I look at the old App in iTunes Connects and goes to Binary Details, it says that the App Id is ED8xxxxxxx.com.rostsolutions.Swisch. So why is the "Certificates, Identifiers & Profiles" page listing the App Id as ATMxxxxxxx.com.rostsolutions.Swisch?
My problem was solved by removing my Apple ID from Preferences->Accounts and then adding it back again. Then all my provisioning profile files showed up on the View Details utility panel. I was mistakenly choosing "Mac Team Provisioning Profile:*" instead of the actual distribution provisioning profile for the project thinking that it was a generic selection. Provisioning files must be specific to the project. Oh, and BTW, make sure your provisioning profile has the correct entitlements (for example, Maps). I managed to release an app with OSX Maps without the entitlement and Apple approved it -- but no Maps showed up on the production version!
In my case, I had the same problem, my solution was to change the 'Release Provisioning Profile' in the Build Settings before doing Archive. I do this twice, once for App Store distribution, and another one for Ad Hoc distribution. I also add a comment on my archives. My conclusion is that there is something broken about the "archive re-signature".
There is a very good tutorial for solving that problem on this website.
It says that this problem can occur when your Projects Bundle Identifier is different to the one you entered on the iTunes Connect Website.
I think xcode 5 uses "release" instead of "distribution" that you may created yourself.
If all above didn't work (in my case after couple of days no luck trying everything) I have only one Mac application. BE CAREFULL WITH REVOKE!
1) Revoke by hand all "Mac App Distribution" & "Mac Installer Distribution"
2) Clean relevant certificates and open-keys in Keychain (Warning: export before delete)
3) Restart Xcode
4) Go to (in Safari) developer.apple.com -> certificates etc.
5) Create CertificateSigningRequest.certSigningRequest in Keychain->Certificate assistant
6) Create by hand on developer.apple.com both "Mac App Distribution" & "Mac Installer Distribution" with your *.certSigningRequest
7) Provisioning Profiles -> Distribution -> create/fix custom provision for AppStore (I'm specially named it as "Mac provision profile for AppStore"
8) Xcode -> Settings -> Account -> Your account -> Refresh
9) Xcode Clean -> Archive -> Validate
I have been struggling with similar problem (I was building for Ad-Hoc distribution). Only thing that has changed since last successful deploy, was adding two devices to provisioning profile.
After double- and triple- checking all build settings, I regenerated provisioning profile (without changing anything), re-downloaded and it worked fine.
So note to self: if there is no logic explanation, you can always try good old IT voodoo.
I also recommend iPhone Configuration Utility, which despite its name, is useful for checking what provisioning profiles you have on computer.
ERROR ITMS-9000: “This bundle is invalid. New apps and app updates submitted to the App Store must be built with public (GM) versions of XCode 5.1.1 or higher and iOS 7 SDK. Do not submit apps built with beta software.
If multiple developers are using the same member center account. One of them can't use a certificate created by others cause they used a certificate request created using their computers.
You need to use a certificate created by you (certificate request
created using your computer).
Alternative, told them to send you the Developer Profile. not sure of the name. to use a certificate created on another computer.
Code signing Entitlements occur because of your resource does not contain Entitlements file in resources,Just go to build setting and search code signing Entitlements delete entry for debug and release, build project again you will see there is no error. Cheers
I had the same problem, but nothing written here worked for me. However, I found a simple way that worked for me. Here's how to do it:
1) In your Project and your Target(s) build settings, choose "None" for all Provisioning profiles, and choose "Don't Code Sign" for all Code Signing Identities.
2) Now, choose your Target and go to build settings. In Code Signing Identity Release setting, choose "iOS Distribution" for "Any iOS SDK". And then, in Provisioning Profile Release setting, choose your distribution profile for "Any iOS SDK". After that your Code Signing Identity Release setting should automatically change to "iPhone Distribution".
3) Archive your build and validate. Now it should work fine. That's it!

Apple Account Not have any Development Teams

I have logged in Xcode settings Accounts with my Apple ID and password, but still it's showing "Not on Any Development Teams". I am using Xcode 6.2.
This is an Xcode bug that has hit a lot of people. What seems to fix it is deleting the account from Xcode prefs using the "-" button, and then adding it back. I've done that on a couple of Macs, more than once, and it has always worked-- for a while. You may need to click "view details..." and then use the reload button afterward to ensure everything is up to date.
In case anyone from Apple happens to see this, please look up rdar://19870347
Download the provisioning profiles and certificates from the Member Center and save them to somewhere you can access them. Then, double-click the profiles and certificates. This should bring up Xcode as well as Keychain. You can dismiss the windows and that should work.
In Xcode, go to build settings and check that under Development and Distribution certificates the corresponding ones are correctly filled in.

None of the valid provisioning profiles include the devices

I have removed some of the devices from the provisioning profile from apple portal for adhoc distribution and downloaded and installed it in xcode 6.
But upon archiving the project it shows the error for missing devices and invalid provisioning profile .
I have wasted 3-4 hours regarding this issue but found no luck.
Any kind of help would be greatly appreciated.
I just had this error as well. I am not sure if all of these steps are required, but the is exactly what I did to fix it, and it worked for me...
On the device, I removed the provisioning profile that was in General -> Profile.
In Xcode, under window tab open up the "Devices" window. (shift+cmd+2)
Choose the device and copy its identifier
Login to developer.apple.com and go to the "Certificates, Identifiers & Profiles" area
If the device in question is not registered, register it in the "Devices" area. (My device was not registered, so I registered it)
In Xcode preferences under Xcode tab, go to the Accounts tab and choose your Apple ID.
Choose the identity from the list and then hit the "View Details..." button.
Under "Signing Identities", only "iOS Development" was listed.
Click the "refresh" button on the lower-left of this details page.
I was informed that I didn't have a distribution certificate and asked if I wanted Xcode to request one for me. I chose Yes (or Request)
'iOS Distribution" then showed up also, just under the "iOS Development" entry
Hit the "Done" button
Exit from the Xcode preferences
Choose the Target for your project, then choose the "General" tab
Choose the "Team" dropdown and pick your team, even if it is already selected. This causes Xcode to refresh its info about the Team.
At this point, my warning next to "Team" went away. I then tried to run my app on the problem iOS device again and it worked as expected.
I hope that by following these steps, it will at least help you get closer to fixing your problem.
I only have this problem when archiving so I do not bother to investigate, unplug the iPhone and archiving works just fine.
In my case I needed to remove the Team ID from the bundle identifier in targets settings > General.
If you have the Team selected below this id will be added automatically.
I followed a lot of the instructions out there about resetting profiles and restarting xcode but still had no luck. Eventually I set team to 'none' and reset the build configuration as indicated here:
https://developer.apple.com/library/ios/qa/qa1814/_index.html
Bingo.
This was for a project I hadn't updated in a year or so and I had just updated to xcode 7.3.
I had a similar problem where my device was properly registered and had been working for some time before suddenly stopping. All of the provisioning profiles were up to date and I was still able to download other Xcode projects onto my device. My developer account was listed as the Team under Targets -> General -> Team but it still wouldn't work. So I switched Team to None and attempted to build the Project again. It gave me an error for not selecting a valid Team, but then an option popped up to choose one of the ones registered earlier in Accounts. I just clicked on my developer ID and that seemed to fix the problem.

An "invalid value" being provided for the parameter 'appIdName'?

I've been working on this app for several weeks, and everything's been great. I've been building and archiving and having a ball. All certificates and profiles and IDs have (seemingly) been in order and working well.
Then a few days ago, seemingly without any change that I can discern, Xcode said I didn't have any "provisioning profiles with a valid signing identity", and when I told it to "fix issue" I would get this error every time:
An invalid value 'Xcode: Wildcard AppID' was provided for the parameter 'appIdName'.
I've found a few questions that seem similar, but I can't find anything at all about this error specifically. Google, SO, nothing. I do have an AppID in the Developer Portal called "Xcode: Wildcard AppID" with an ID of *, and I've tried making another (as suggested in those other questions) but it hasn't helped.
Can anyone explain what this error means, and how I might go about fixing it? And for bonus points, what caused it so I can avoid this in the future?
I was able to get it working. I tried what Cirec Beback suggested, but here are more specific instructions:
Go to the Apple Developer Member Center, and sign in
Go to your "Certificates, Identifiers & Profiles"
Under "iOS Apps", select "Provisioning Profiles"
Near the top, in the "iOS Provisioning Profiles" header, hit the + button
Select "iOS App Development" and hit Continue
From the dropdown, select your "Xcode: Wildcard AppID" option and hit Continue
Select your user, or everybody, and hit Continue
Select whatever devices you want, I did all of them, and hit Continue
Give the Provisioning Profile a name, and hit Continue
The next screen will have instructions, but basically it will have a download link, so download the provisioning profile, and open it. Then you should be all good!
This may happen if you do not have an updated provisioning profile.
To fix..
Go to Xcode preferences.
From the top tab select Accounts.
Click View Details button(Bottom right).
A screen will open showing all the provisioning profiles. Click the
refresh button (Bottom left) and wait the refresh to finish.
Check your bundle identifier(General tab) and your provisioning
profile(Build Settings).
Clean build.
Another explanation for this error message is that your app bundle id contains an unsupported character such as an underscore.
I just had this today (which is why I'm here). In my case, it was just because the build settings had the wrong Code Signing Identity and Provisioning Profile. It had nothing to do with the XCode wildcard.
The issue for me was that I had an existing app, with an existing appID, that did not have App Groups enabled. This was warned not just in capabilities, but also when I selected my main app target and viewed the Identity section.
I went to developer.apple.com > Certificates, Identifiers & Profiles > Identifiers
In Identifiers > App IDs: Selected my App ID
Clicked Edit, and enabled App Group under application services
Then went back to XCode and refreshed the Target General. Then back to Capabilities and let it "fix" it.
Wanted to let you know I had the same issue today. Might be an Apple issue. Anyway, I was able to go out to developer.apple.com and create the provisioning profile the old fashion way. xCode picked it up and was able to use it without any further issue.
I was having about the same issue on an Ionic project:
An invalid value '-widget-id--com.myapp.main--version--0.1.19--xmlns--http---www.w3.org-ns-widgets--xmlns-android--http---schemas.android.com-apk-res-android--xmlns-cdv--http---cordova.apache.org-ns-1.0---com.myapp.main' was provided for the parameter 'appIdentifierString'.
An invalid value 'XC -widget-id--com myapp main--version--0 1 19--xmlns--http---www w3 org-ns-widgets--xmlns-android--http---schemas android com-apk-res-android--xmlns-cdv--http---cordova apache org-ns-1 0---com myapp main' was provided for the parameter 'appIdName'.
After looking for awhile, I figured out that my platform/ios/MyApp.xcodeproj/project.pbxproj has it PRODUCT_BUNDLE_IDENTIFIER filled with
-widget-id--com.myapp.main--version--0.1.19--xmlns--http---www.w3.org-ns-widgets--xmlns-android--http---schemas.android.com-apk-res-android--xmlns-cdv--http---cordova.apache.org-ns-1.0---com.myapp.main
I have no idea on how it happened but putting com.myapp.main fixed it!

How to submit to iTunes Connect in XCode 6

This must be the worst question ever asked.
I'm almost ashamed to ask it but I can't wrap my head around this.
We are trying to push my app to itunes connect for beta testing.
Now there is no way to do this because XCode 6 gives all signing errors available.
We are able to run the app on the development device just as usual. We have the profiles.
But when we set the release sign identity to iOS Distribution, the hell breaks loose.
No matching identity was the first error. Fix issue releases another error:
No provisioning profiles with a valid signing identity were found.
It's useful to note that XCode knows this better than I do so it changes the code signing identity back to developer.
That's not me, I want to distribute.
Ok so at this time we're stuck at this error. We don't know where it came from, but we do know there was another error.
While pressing the submit button in the organizer the error was:
"You already have a valid provisioning profile"
According to the apple documentation I should press the revoke & request button but that isn't there.
So here we are, totally stuck and have no idea where to go now. The apple docs are incomplete, the signing gives errors but no logs. Errors messages change, but are consistent.
What the hell should we do now?
Reinstall OSX and remove all existing profiles? What will happen with current clients running apps on those profiles?
Have a look in yoru account and check that the provisioning profiles are active and not invalid. You might need to regenerate it.
You might also want to download them manually and install them yourself.
Sometimes I've had to archive the app then submit 'manually' using application loader.
I would recommend going back to basics:
check your development and distribution profiles on the developer site. if you have recently renewed your annual subscription, you might need to recreate them.
when you are archiving make sure you chose the real testing device, not a simulator.
if both doesn't work, create a new empty project and sign it with the profiles and archive. if that works, then check if you altered the bundle settings. if it doesn't work, delete your profiles and recreate them.
I hope that helps.
Hmm. I understand the plight of having to deal with the overly complex process of app submission which should have been rather simple.
Two things:
Make sure you delete all the provisioning profiles. Revoke and request a new one. Create a new certificate with distribution licence (you can make upto 3).
Once you've done that go to tour XCode > Preferences > Accounts and open up the apple id you find there. Refresh and that should download and fix redundancies.
For more I think you should also give this a read.
How do you beta test an iphone app?
About you second issue. What would happen to apps packed with previous profiles?
Well, your app is not bundled with a particular profile and so you can create a new one and use that without pain

Resources