skip to Main Content

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


  1. I commented-out/removed

    <key>com.apple.developer.healthkit.access</key>
    

    in .entitlements and it works!

    Login or Signup to reply.
  2. Solution

    What worked for me was to remove the following line in the .entitlements file

    <key>com.apple.developer.healthkit.access</key>
    <array/>
    

    Validation

    • I double checked and the HealthKit access still works for read/write when building via Xcode
    • I tested the app via TestFlight and everything still looks good
    • My app got approved and everything works fine for existing and new users 🙂

    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:

    <key>com.apple.developer.healthkit</key>
    <true/>
    <key>com.apple.developer.healthkit.access</key>
    <array/>
    
    Login or Signup to reply.
  3. 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:

    Login or Signup to reply.
  4. 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.

    Login or Signup to reply.
  5. For me solution is to remove the following line in the .entitlements file

    <key>com.apple.developer.healthkit.access</key>
    <array/>
    

    !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!

    enter image description here

    Next, you must provide a Health Records Usage string in your app’s Info.plist file.

    enter image description here

    Login or Signup to reply.
  6. 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:

    • I have an entitlements file with a key for "com.apple.developer.icloud-container-identifiers" entitlement with an empty array like so:
      <key>com.apple.developer.icloud-container-identifiers</key>
      <array/>
    
    • This was fine until just yesterday (I successfully submitted a build, and have submitted builds like this for more than a year).

    The Fix:

    Remove or Comment out the following line from the .entitlements file:

      <key>com.apple.developer.icloud-container-identifiers</key>
      <array/>
    
    • The key was empty anyway so should not have an effect after being removed.

    Now the TestFlight submission is successful.

    Login or Signup to reply.
  7. Same error for me with "icloud-container", just comment these lines in your . entitlements file:

    <key>com.apple.developer.[YOUR-ERROR]</key>
    <array/>
    
    Login or Signup to reply.
  8. 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.

    Login or Signup to reply.
  9. I had the same issue with Network extensions, it is also empty and deleting it from Entitlements solved the issue.

    Login or Signup to reply.
  10. 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:

    *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Application initializing
    document picker is missing the iCloud entitlement. Is
    com.apple.developer.icloud-container-identifiers set?’

    Login or Signup to reply.
  11. What worked for me

    Before started trying, I checked my .entitlements file it looks like this:

        ...
        <key>com.apple.developer.healthkit</key>
        <true/>
        <key>com.apple.developer.healthkit.access</key>
        <array/>
        ...
    

    Step 1: Remove and add HealthKit capability again.

    • Remove HealthKit from "Signing and Capabilities"

    • Add HealthKit back

    2

    Step 2: Check on "Clinical Health Records"

    3

    Once done, you shall be able to see your .entitlements file become

        <key>com.apple.developer.healthkit</key>
        <true/>
        <key>com.apple.developer.healthkit.access</key>
        <array>
            <string>health-records</string>
        </array>
    

    Step 3: Add Privacy - Health Records Usage Description and its value to info.plist

    Final: Then I tried to archive and upload to TestFlight, it worked.

    Login or Signup to reply.
  12. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search