App Store Distribution fails on valid com.apple.developer.healthkit.access value

The error trying to distrubute to the store
Code Block
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/<app>.app/<app>'

Looking at the docs, this is a valid value:
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_healthkit_access

Similarly, I had no issue until this appeared randomly....

Entitlement File
Code Block
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.healthkit.access</key>
<array/>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>webcredentials:invoy.com</string>
<string>webcredentials:invoy.dev</string>
<string>webcredentials:invoydev.com</string>
<string>webcredentials:invoystage.com</string>
<string>applinks:invoy.com</string>
<string>applinks:www.invoy.com</string>
<string>applinks:invoy.dev</string>
<string>applinks:www.invoy.dev</string>
<string>applinks:invoydev.com</string>
<string>applinks:www.invoydev.com</string>
<string>applinks:invoystage.com</string>
<string>applinks:www.invoystage.com</string>
</array>
<key>com.apple.developer.healthkit</key>
<true/>
</dict>
</plist>


HealthKit is enabled as a capability in Apple Profile as well as for the product.

Does anyone have an idea of what could be going wrong? Seems like I am correctly following the practices.
Answered by bricepollock1 in 656525022
I removed com.apple.developer.healthkit.access and fixed it.
Check your App ID Configuration under 'Certificates, Identifiers & Profiles' in your Developer account.

If you have anything checked that you're not actually using then you need to uncheck it or configure it correctly. In my case I had iCloud checked but didn't have a container attached.

Using Expo I had to clear out my provisioning profile and rebuild as well.

Hope that helps!
Still not resolved, but if you're here you already knew that
Any help / explanation from apple why builds suddenly fail?
Same problem.
Kindly update if you see any fix without removing the healthkit.
I have the same issue.

You can't just remove the key com.apple.developer.healthkit.access because then the general entitlement for HealthKit will also disappear from Signing & Capabilities.

I have also submitted multiple tickets to Apple since I've hit this brick wall.

Perhaps enabling "clinical health records" may bypass the error, but Apple says if you include this entitlement but don't use clinical data, then you will be rejected.

Also, Xcode creates and populates this file, so manually editing this file should not be necessary.

Apple developers, please fix this ASAP
Code Block language
<key>com.apple.developer.healthkit.access</key>
<array/>


Since the message complains about passing an empty array I removed only the <array/> and all worked fine.
HealthKit still listed in XCode capabilities and archive successfully uploaded to TestFlight.
Same issue for me regarding HealthKit — I don't want health record access, but I cannot remove the key from my entitlements file without removing the HealthKit entitlement entirely. Uploads to TestFlight worked fine with an empty array for com.apple.developer.healthkit.access on 12 January, 2021, but started failing for me yesterday.

I've filed FB8972571.
NONE of these hacks of the .entitlements file are "fixes." @Apple fix this yesterday.
I have the same issue with my code and since it's complaining about an empty array I have added <array> to the beginning of the list.

Code Block Language swift
<dict>
    <array>
<key>com.apple.developer.healthkit</key>
<true/>
    <key>com.apple.developer.healthkit.access</key>
    <array/>
</dict>

I have submitted it to TestFlight

Having the same issue, it's not fixed yet, unfortunately
The fourth day can't upload the app. Still waiting for a fix on the Apple side.
Removing line with access removes Apple Health Kit capability from the capabilities list, so I'm unsure about this solution...

Within build from Testflight — Apple Health is working. Brrr...
I am still waiting.
I'm surprised Apple hasn't addressed this yet. Does anyone have an open ticket with them?
Also have the same issue. Hopefully a fix is imminent.
App Store Distribution fails on valid com.apple.developer.healthkit.access value
 
 
Q