Provisioning Profile and NSUbiquitousKeyValueStore Problems - ios

The app I'm currently working on was originally developed by someone else on another mac and has several provisioning profiles linked to it. I made a new provisioning profile about a month ago to test on the same device the original developer tested on and everything was working fine. Since the past couple of days I have received this error when running the app on a device:
NSUbiquitousKeyValueStore error: com.companyname.appname has no valid com.apple.developer.ubiquity-kvstore-identifier entitlement
I researched this error and came to the conclusion that my entitlements were wrong in some way. I then discovered they were turned off which is something I did to get the new provisioning profile to work on the device. I turned the entitlements on again and got this familiar error:
The executable was signed with invalid entitlements ... (0xE8008016).
I've tried a lot of suggestions from various sources on the internet to solve this problem but none of them seemed to work, which is why I originally turned the entitlements off (the one suggestion that worked).
The provisioning profile I created is listed as valid under the devices' provisioning profiles tab. There are 4 other provisioning profiles which are only listed in the libraries' provisioning profiles tab.
Can an app be uploaded to the store without an entitlements file?
Can the final distribution of the app and upload of the binary be conducted and the NSUbiquitousKeyValueStore error: won't be present?
Can anyone give me a fairly comprehensive step by step guide to completely removing the link between the old provisioning profile and the current entitlements or a way of changing the entitlements file to work with the current provisioning profile?
I am aware this sort of error is pretty hard to diagnose and solve but any help is appreciated.

I discovered the source of my problem to be that the provisioning profile I was trying to sign the app to had a wildcard* appID so therefore would not match. A pretty stupid error but one possibly other people may encounter.

Related

xcode uploading to app store - No matching provisioning profiles found

I am having difficulty with uploading my app to the app store, I get the error "Failed to locate or generate matching signing assets: No matching provisioning profiles found for..." I'm not quite sure what this error means or how to fix it. I am somewhat new to xcode and the app store uploading process.
To my knowledge I've created everything necessary on the developer website to upload an app, and non of my certificated have expired. I've done some research and read other posts but so far everything others have suggested has not worked for me.
Hopefully I'm making a simple beginner's error that can be easily corrected.
It shows the actual reason in the error message you posted your matching profiles do not contain the same entitlements as your app says is requesting.
Check your Project -> Capabilities and see which are set to on. Then on your provisioning portal check that your app has the same capabilities set.
If you don't need those capabilities simply turn them off and you should be able to build. If you do then you will need to set them up in the relevant App IDs on the provisioning portal. Identifiers-> App Ids -> app -> Edit
Some of these changes will require you to regenerate your provisioning profiles which you can do by clicking edit and then re-generating from the provisioning profiles section of your apple developer account.

Xcode validation failure

Validation of an archive for uploading to the store is failing in the Xcode Organizer with this message: "Failed to locate or generate matching signing assets: Xcode attempted to locate or generate matching signing assets and failed to do so because of the following issues. Permissions failure - Your account does not have permission to create profiles."
This problem has been reported by several other people on StackOverflow and Apple Development Forums, with no resolution. Here I'll explain some things I've tried with the hopes that maybe someone can suggest a solution. This is a really important problem because it's preventing release of an app.
Does anyone know how to fix this? Does anyone know what the "permission to create profiles" is referring to? From my understanding, the Organizer should just be signing the app with an existing Provisioning Profile, not creating any new ones.
Background information: I have admin privileges in a company team and am able to build the project fine. My development certificate works ok for installing to a phone. There are no expired certificates in my Keychain and the certificates in the key chain look ok. I have rebuilt the Distribution certificate and downloaded it to my Mac successfully.
The problem occurs whether I select manual or automatic provisioning in Project Settings (though this shouldn’t affect archive validation anyway). I have the original distribution Certificate on my machine from importing a .p12 file from the original developers. I’ve tried rebooting my Mac, restarting Xcode.
Issues I can think of looking at next: (1) I am using a wildcard in the app bundle name in the Distribution Provisioning Profile. Is there any problem with this? The wildcard seems to match the app bundle ID in the build. The app has previously been released without an explicit app bundle name in the provisioning profile. (2) The distribution provisioning profile has no services enabled. The app Project Settings include one service: Remote Services under Background Modes. Is there a problem because of this mismatch? (3) Should I try using Application Loader instead of the Xcode Organizer?
The problem, it turns out, was a bad Distribution Certificate. The team I was working for turned out to have two Apple Developer accounts with the same name, but one was an Enterprise account and the other was not. I had been given the Distribution Cert for the Enterprise account. Once I deleted all my relevant certificates from my keychain and XCode Preferences/Accounts and read in the .p12 file for the correct Distribution Cert, everything worked.

No matching provisioning profiles

Though I had been a while without seeing such an error, I recently got this message, when trying to archive an app written in Objectiv-C:
Xcode attempted to locate or generate matching signing assets and failed to do so because of the following issues.
No matching provisioning profiles found for "Applications/myApp.app"
None of the valid provisioning profiles allowed the specified entitlements: application-identifier, beta-reports-active, keychain-access-groups.
I haven’t changed anything in my settings, and this error seems to appear with recent versions of Xcode. I am using Xcode 6.3.2.
When I wanted to archive an app written in swift, I did not have this problem.
I do not see why the language would be related to the provisioning profiles, but that just something I noticed.
I tried to use a brand new provisioning profile, but it didn’t make any difference.
I also tried Refresh accounts from Xcode preferenced, but again with no luck.
Of course I looked for some solution on the net, but everything failed.
Refresh Provisionning profiles from XCode - Preferences - Accounts - View Details - refresh button
Connect to Itunes Member Center to agree on the new Apple Developer Agreement
It will take some minutes to propagate through the network if you click on the agree button (I had to wait 10 minutes)
eventually refresh again your provisioning profiles in XCode And eventually, check that your Distribution certificate is still valid in the iTunes Member Center

Xcode 6 invalid entitlements in my project

I want to distribute my app, but when I run it it shows me message:
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016).
I already watch my distribution account and Capabilities in Xcode and
entitlements in them are the same. In what can be problem?
I also get this exception few times when I did something with provisioning profiles or capabilities, In my case its always in iCloudkit (xcode 6) issue, for some reason in app id (if you check in developer center) it assigned invalid or unwanted icloud containers to the app id. So i remove them and only added one correct container to fix this issue.
I had this problem recently, You will find many questions here with the same issue, check this question for the approved answer The executable was signed with invalid entitlements (iPhone build)
For me, I didn't do this. I tested the app on the device using the development certificate and the ad-hoc one, Then submitted it using the disruption certificate after making sure that there is nothing wrong with my certificates.
You probably need to check your Bundle ID value in both your .plist file and also here:
(This really is the most developer-unfriendly environment in use in 2016...)

iOS - cannot validate my app "No identities are available for signing" [duplicate]

I have an error "No identities are available for signing" when try to validate my app in Xcode 5. I tried all: Recreate certificates and provisioning profiles, all methods which have been described on this site and another resources; I'm confused, because when I try to distribute my app as Ad-hoc, it successfully create and install on test device an IPA file. But when I try validate my app or submit to AppStore, all the time I have an error. Maybe someone can help me with this issue.
All you need to do is:
go to Certificates, Identifiers & Profiles in the Developer Center
create a new provisioning profile in "Provisioning Profiles" / "Distribution"
download the profile and open it
restart Xcode
Please make sure you are using distribution provisioning profiles, rather than Development.
And the code sign setting in Xcode is compatible with the distribution provisioning profiles.
The validation process does not work with Ad-hoc profiles. Need to create a Distribution provisioning profile. It is not specified in the instructions for beta testing. I agonized all day until realized.
Use the Application Loader (Xcode -> Open Developer Tool -> Application Loader).
Also - this answer/question may also be helpful for you:
https://stackoverflow.com/a/18914073/730172
Restarting Xcode solved the problem for me! Restart and/or clean solves 99% of all issues...
#CainaSouza 's comment above worked for me. I didn't even have to create any new provisioning profiles.
I just had to go to Xcode > Preferences > Accounts > (Apple ID) > View Details and hit the refresh button. After a minute or two it was done and had loaded my provisioning profiles. I didn't even have to select it in my project options, it had already selected my most recently generated one.
Clean your Product Build Folder (with Alt button)
Restart Xcode
It solved my same issue
I had a similar issue. Found out that the bundle identifier did not match the app id that was on itunes connect - it was capitalized differently. Fixed the issue by making the identifiers match.
Yes the appID and bundle identifier must match. Remember it is CASE-SENSITIVE. That was the problem for me.
I updated to Maverick and Xcode 5 and had the same issue even though I had everything ok in Profiles. I created a new Distribution profile (identical to the old one), added it by refreshing profiles and the issue was solved without rebuilding.
Apple Decided to "Magically Dissapear" my distribution provisioning profile from their site after upgrading to a newer Xcode, giving me this problem too.
Solution is obvious only once I had discovered this fact!
-Create new Distribution Provisioning Profile
-Download & install it / Refresh Xcode preferences under account details
I fixed this issue by delete the old development/distribute profiles and create new one with new names.
I had a mismatch between the Bundle Identifier within Xcode and the App ID on Developer.Apple.Com (Certificates, Identifiers & Profiles). This StackOverflow post was a great help to me. For a little extra info check out this blog post. The official documentation for the touch command can be found here. I had quit Xcode before doing the below. Upon completion of the details below and reopening Xcode my issue was resolved.
Use a text editor to update the bundle identifier to match the App ID, the Info.plist file is located:
ProjectName > ProjectName > ProjectName > ProjectName-Info.plist
Your looking for the following lines:
<key>CFBundleIdentifier</key>
<string>MyCompany.${PRODUCT_NAME:rfc1034identifier}</string>
Update the value to match you App ID, eg:
<string>com.MyCompany</string>
Use the terminal to issue the touch command, ensure your within the above listed directory:
touch ProjectName-Info.plist
If you are using Xcode 5.1 or above (which you would be now), this helped me: Code signing broken on Xcode 5.1 + iOS 7.1
The key is to delete the old provisioning profile on your mac and create a new one (with a different name?) from Apple web site and download it. Looks like Xcode 5.1 corrupts the existing provisioning profile and it does not help even if you re-download it again.
My solution was to go into the dev center, find the distribution provisioning profile, and it had expired. So i tapped edit on it, and renewed it, downloaded it, installed it, chose the profile in the build settings, and it worked.
HTH someone.
Of all the development issues I've faced over my 20+ years as a software developer, none have wasted so much time as the code-signing/provisioning profile rubbish in Xcode.
This week, I have wasted 8+ hours trying to build an Ad-hoc release of our iPhone app. In the past, it just worked, I could Archive, stick a download button on our in-house webpage, and users could just install our app from this page.
But, this week, I was facing the same "No identities are available" issue, described here.
EVENTUALLY, here's what solved the issue for me:
When I logged into the hopeless Apple Developers website, it showed that our company had 2 "iOS Distribution" certificates. They were valid, their expiry dates are months away, and in the Keychain Access application, the certificates were installed and valid... no problems here.
But what fixed my issue was to delete these two certificates, recreate a new one, then recreate my "In house" Provisioning Profile (as the original one was now showing as being invalid, as it used the old "iOS Distribution" certificate).
I also went into the "Keychain Access" application on my MacBook, and deleted all "iOS Distribution" keychains.
Then, I downloaded the new certificates & provisioning profiles, now, finally, Xcode would report that there was an identity which I could code-sign with.
To the Xcode development team:
Please. Get this fixed.
If a developer like myself, is up against a wall, unable to get a valid Provisioning Profile, which will result in a downloadable app, which will fail each time on "The app couldn't be downloaded at this time" message.. DON'T allow the Archive function to be used.
Instead, TELL the user what the problem is. HELP them resolve it, rather than going through the motions, and happily allowing them to create Archives which will never be useable.
And if an Ad-Hoc install is invalid, please put something in the Log to explain what's gone wrong, and make this accessible from Xcode. Currently your "The app can't be downloaded at this time" message is both useless and misleading.
One last thing (if this helps):
Our company accidentally let its Developer Enterprise Program license expire last month. We did then renew, everything was seemingly okay again, but perhaps, behind the scenes, this messed up our "iOS Distribution" certificate ? And perhaps, not. From the Apple website's point of view, everything was fine.
My issue was that I had none.myApp in my Bundle Identifier whereas in the AppID, I had com.myApp.
This drove me crazy for hours.
I ran into this issue today and it seems to be related to the face that the profile started with a number. I deleted the profile and recreated it exactly the same way (after a lot of other troubleshooting steps found on SO) EXCEPT this time I started with a word instead of a number. Coincidence? Not sure but worth trying.
Had this yesterday and could not figure it out, no matter what I did! To solve the problem, I went to both the Project and the Target in Xcode, and under code signing, chose
Code signing identity: Don't code sign
Provisioning profile: None
Build, and then Product > Archive, and now Organizer chose the correct code signing identities and profiles to allow it to get to the Validation step. Woohoo!
It happen to me after update Xcode.
I fixed doing the follow
change the sign in to "no sign"
restart Xcode
set it to the correct sign
re-archive the build
I hope it helps
Apple Documentation
"If Xcode doesn’t find signing identities, a dialog stating “No identities are available for signing” appears. Verify that you have a distribution certificate and an ad hoc provisioning profile before continuing.
If your ad hoc provisioning profile doesn’t appear in the Provisioning Profile pop-up menu when you create the iOS App Store Package, refresh the profiles in Xcode, as described in “Refreshing Provisioning Profiles in Xcode.”"
In my case, the adhoc provisioning that I wanted to set was not selectable in Code Signing in Build Settings. Though, I created and downloaded the adhoc provisioning from developer store. The answers mentioned here didn't work for me. Fix Issue button in General tab fixed the issue by downloading the required adhoc provisioning file by itself.
Creating a new certificate, Profile in Apple development center did not work for me! I tried editing a profile/certificates and download again and double click to install in KeyChain, but still did not work. I restarted XCode (Version 7 and Mac on El Capitan), restarted Mac but still did not work!
What worked for me is:
XCode -> Preferences -> Accounts - Then I deleted the Apple ID.
Shutdown my Mac, and restarted it.
Started my XCode, added the Apple ID, went to view details in Apple ID's and downloaded the Provisional Profile again and only then it started working!
Restarting solved my problem. I have a new mac and tried downloading the profiles, which should've transferred anyways. restarting solved it.

Resources