The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile

IosXcodeFlutter

Ios Problem Overview


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.

Ios Solutions


Solution 1 - Ios

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.

Solution 2 - Ios

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

Solution 3 - Ios

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:

Solution 4 - Ios

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

Solution 5 - Ios

Same error for me with "icloud-container", just comment these lines in your . entitlements file:

<key>com.apple.developer.[YOUR-ERROR]</key>
<array/>

Solution 6 - Ios

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.

Solution 7 - Ios

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.

Solution 8 - Ios

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

Solution 9 - Ios

I commented-out/removed

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

in .entitlements and it works!

Solution 10 - Ios

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.

Solution 11 - Ios

I had the same issue with Network extensions, it is also empty and deleting it from Entitlements solved the issue.

Solution 12 - Ios

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?'

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJohnView Question on Stackoverflow
Solution 1 - IosNYSamnangView Answer on Stackoverflow
Solution 2 - IosMarceeelllView Answer on Stackoverflow
Solution 3 - Ios123 superatomView Answer on Stackoverflow
Solution 4 - Ioskiril kiroskiView Answer on Stackoverflow
Solution 5 - IosJulien DelferiereView Answer on Stackoverflow
Solution 6 - IosJoost van den AkkerView Answer on Stackoverflow
Solution 7 - IosSean ChenView Answer on Stackoverflow
Solution 8 - IosAnishView Answer on Stackoverflow
Solution 9 - IosthunpisitView Answer on Stackoverflow
Solution 10 - IosMacMarkView Answer on Stackoverflow
Solution 11 - IosAlex MetelkinView Answer on Stackoverflow
Solution 12 - IosNaresh KalakuntlaView Answer on Stackoverflow