I have submitted many app builds to TestFlight, even yesterday, but today when I tried to submit my app to TestFlight via XCODE I get the following error:
ERROR ITMS-90164: "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: '[ ]' for the key 'com.apple.developer.healthkit.access' in 'Payload/Runner.app/Runner'."
I’m building a flutter project via XCODE. I have tried the following:
- Cleaning my project.
- Re-enabling automatic app signing in XCODE.
- Deleting my provisioning files from ~/Library/MobileDevice/Provisioning Profiles/
- Disabling automatic signing in xcode and creating my own provisioning profile via the Apple Developer site
But I’m still getting this error. My enablements haven’t changed from the last time I uploaded my app. Please help, thank you.
UPDATE 1:
Appears to be a change made on Apples end that is causing this error. No official response/explanation from Apple has been provided yet. Some workarounds have been provided below. I went with enabling Clinical Health Records usage for the Health Kit enablement since this workaround doesn’t use any non-apple approved changes. So still technically not a final solution, but a workaround.
UPDATE 2:
Apple has resolved the issue on their end, no workarounds are required anymore.
12
Answers
I commented-out/removed
in .entitlements and it works!
Solution
What worked for me was to remove the following line in the
.entitlements
fileValidation
Side notes
I had the same issue. I haven’t changed the entitlements for months and out of a sudden that error appeared. It might be the case that Apple changed some logic and applied stricter rules on their backend entitlement validation.
Interesting that if you create a new Xcode project and add the HealthKit entitlements it creates the entitlements like:
Remove ‘com.apple.developer.healthkit.access’ won’t help the issue. So far we can just hope to wait for Apple to fix this.
Thread on forum (i can’t access the Marceeelll’s thread):
https://developer.apple.com/forums/thread/671352
Related:
A key with a value that is an empty array seems to be not allowed in entitlements anymore. Just removing the key/value pair fixed it for me.
For me solution is to remove the following line in the .entitlements file
!This work if you submit the app for TestFlight!
This does not work if you submit the app for review :(. Binary will be rejected ITMS-90000: This bundle is invalid – $message.
What work for me: First, when you enable your app’s HealthKit capabilities: you must also select the Clinical Health Records checkbox!
Next, you must provide a Health Records Usage string in your app’s Info.plist file.
I was facing the similar error.
I believe the Apple back-end has changed and has started applying a stricter rule to entitlement keys that take array values.
I believe the Apple back-end used to accept empty arrays for entitlement keys that took array values but now require the entitlement key to either not be present at all or to contain actual values.
Evidence to back this assertion:
The Fix:
Remove or Comment out the following line from the
.entitlements
file:Now the TestFlight submission is successful.
Same error for me with "icloud-container", just comment these lines in your . entitlements file:
Deleting the empty iCloud Container entitlement (array) from the entitlement files solved the issue for me. Seems like a server-side change from Apple that no longer allows an empty array there.
I had the same issue with Network extensions, it is also empty and deleting it from Entitlements solved the issue.
Deleting the empty iCloud container entitlement will resolve the upload issue. But the app cannot select any documents from iCloud using document picker (UIDocumentMenuViewController).
We would end up with a crash in the app as below:
What worked for me
Before started trying, I checked my
.entitlements
file it looks like this:Step 1: Remove and add HealthKit capability again.
Step 2: Check on "Clinical Health Records"
Once done, you shall be able to see your
.entitlements
file becomeStep 3: Add
Privacy - Health Records Usage Description
and its value toinfo.plist
Final: Then I tried to archive and upload to TestFlight, it worked.
Apple has fixed the issue. You can now try submitting app to TestFlight without making any changes.
Thread on Apple Developer forum: https://developer.apple.com/forums/thread/671352