iCloud Key-value storage signin error after changing team ID - ios

Provisioning profile "iOS Team Provisioning Profile: com.company.appname" doesn't match the entitlements file's value for the com.apple.developer.ubiquity-kvstore-identifier entitlement.
I've changed my application team id and after that it returns above error when using Automatically manage signin when I use Key-value storage option in iCloud.
My application already published on AppStore. How can I fix this issue?

Related

Contacts notes entitlement not showing in app store provisioning profile in xcode

We have applied for com.apple.developer.contacts.notes entitlement to apple and got the option enabled in app id. We created an app store provisioning profile with this app id and we can see that this entitlement is enabled in developer site.
But when downloading and using the same provisioning profile in xcode, it is showing error "Provisioning profile "MyApp_AppStore" doesn't include the com.apple.developer.contacts.notes entitlement."
Why is this happening? I have added com.apple.developer.contacts.notes YES in entitlements file. Please help us figure out why this error is coming?

Can not validate iOS archive for distribution on test flight

I am trying to prepare an iOS app for distribution on test flight (and eventually on the app store).
The Apple developer account admin has sent me the .cer file and the .p12 private key (which they just created). I have added both to my keychain.
Inside of xcode organizer, I select the app and hit validate. I then subsequently select "Automatically manage signing" and hit next.
I am then presented with 4 errors.
This request is forbidden for security reasons. You do not currently
have access to the membership resource.
No signing certificate iOS distribution found. No "iOS distribution"
signing certificate with ID blah with a private key was found.
Team "my team" does not have permission to create iOS app store
provision profiles. Select a different team and try again.
No profiles for [my bundle id] were found. XCode couldn't find any iOS
app store provision profiles matching [my bundle id]
I was under the impression (from what I have read) that having both the distribution cert and the private key in my keychain would be sufficient to distribute the app.

"Provisioning profile does not match the developer certificate" error when setting up GreenhouseCI

Trying to set up a new app in GreenhouseCI and running into an error when attempting to input the Provisioning profile and Certificate files. The error states:
Provisioning profile does not match the developer certificate
I exported my private developer key and have downloaded the mobile provisioning file from the Apple Developer portal. But when I try to save I get the following error:
GreenhouseCI screenshot
Figured it out - it's important to make sure that the mobile provisioning file is created under the 'Development' section and NOT the 'Distribution' section. Either select an existing Development profile or create a new one, and add your personal certificate to the profile. Download that file and upload to GreenhouseCI.
Apple Developer center screenshot

Does enabling Keychain Sharing alter your AppID?

I notice when I enable Keychain Sharing in Xcode for my iOS app Xcode says it will "Add the Keychain Sharing entitlement to your App ID", and it does appear to connect to my account because I get a popup asking which developer account to use. However on the dev portal there's no visible change to any of my App IDs, and my provisioning profile isn't invalidated like it sometimes is when I change an app's entitlements. Keychain Sharing isn't a visible option to enable/disable in the App ID, either.
Does anyone know what Xcode is doing under the covers here? The local change to the entitlements file is obvious, but I'd like to understand the App ID side of it.
Every keychain item in iOS contains an attribute called the keychain access group. An iOS app can only access those keychain items it has permission to. This permission comes from the code signing entitlements stamped into the app when it is signed.
By default, an app can only access keychain items with the keychain access group matching the application-identifier code signing entitlement. However, if a developer wants to share keychain items amongst their apps, they can add a custom keychain-access-groups code signing entitlement that specifies an array of keychain access groups that the app can access.
Normally one creates keychain items without setting the access group attribute kSecAttrAccessGroup. In that case, Keychain Services will automatically set that attribute to the default value. If there is no keychain-access-groups entitlement, the default is the value of the application-identifier entitlement. Otherwise the default is the value of the first array element in the keychain-access-groups entitlement.
When using the Xcode Capabilities editor on the target settings pane to turn on Keychain Sharing, Xcode will add the required App ID Prefix (Team ID) to the front of any listed Keychain Group items at build time. You can see that in the generated entitlements file represented by the build setting $(AppIdentifierPrefix).

Setting an Entitlements file - The executable was signed with invalid entitlements

As soon as I check "Use Entitlements File" in Xcode, I get the following error when I try to run my app on my phone:
The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements
file do not match those specified in your provisioning profile.
I'm trying to get iCloud working, and it seems like I'm failing on step 1. I can run in the emulator, but not in the device I provisioned automatically through the organizer.
What am I doing incorrectly here?
First of all, you need to have specific provisioning for your App's ID, matching its bundle ID. Even if it's only for development, generic Team Provisioning cannot work to test iCloud.
If the App ID had been issued without iCloud enabled, and updated afterward, related Provisioning must be updated also.
Often, provisioning updating from Xcode's organizer fails to bring the right one. In this case, I suggest you to try to download updated provisioning directly from iOS Developer Website.
In my case, I have added inter-app capability in my iOS project and Xcode automatically suggested to add this permission in the app id (bundle id) in the provisioning portal and I did so. After this
I thought it was fixed since Xcode was showing tick marks for all under inter-app audio sections as follows
Add the "Inter-App-Audio" entitlement to your APP ID
Add the "Inter-App-Audio" entitlement to your entitlements file
Link AudioToolbox.framework.
Actually it was not fixed and I had to generate another distribution certificate with inter-app enabled and only when I signed with that distribution certificate I was able to install the app.
You Need to have Developer Certificate And Private Key in your keychain And Provision profile that have created must match with this Certificate.

Resources