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.
After frustration with this issue not being fixed on Apple's side, I followed the suggested answer, even though it does seem like a hack and not officially supported workaround. However, I can confirm that both of my Testflight and App Review builds have been approved by Apple. I am still wary to launch the update into the wild, and so won't hit the push button just yet. But I can confirm HealthKit read + write on Testflight still works properly. If no resolution appears, I'll submit the update by end of week.
I have submitted this issue to Apple even required DTS
2 days past, I get no reply
First time to feel annoyed at Apple's Service
Deleting doesn't work properly. It prevents writing to Health App because app even cant request access to writing to Health App without this key in entitlement. Unbelievable. Seems like we all need to write to Tim to fix this issue. Apple doing nothing.
I have tried by adding "<array>" in an entitlements. Its not matching with Provisioning profile capabilities.

So i have tried by removing com.apple.developer.healthkit.access from entitlements and Provisioning profile. Then got the error "Error = Error Domain=com.apple.healthkit Code=4 "Missing com.apple.developer.healthkit entitlement." UserInfo={NSLocalizedDescription=Missing com.apple.developer.healthkit entitlement.}", while requesting the health kit authorization.


So nothing is working for me. Just waiting for apple solution. It has been 6 days without any solution, please help us Apple!
removing <key>com.apple.developer.healthkit.access</key><array/>
exactly from entitlements source code fixes the issue. I was able to upload to App Store and it works correctly on TestFlight,
but in Capabilities pane in project i do not see HealthKit anymore. But it works.

This is the way.
Please, everyone: Apple doesn't seem to be interested in this forum, so submit your feedback https://feedbackassistant.apple.com/
I have removed the <key>com.apple.developer.healthkit.access</key><array/> entry from my entitlement file. It indeed worked for testflight, so I decided to submit it for review. Just gotten the rejection message.


Everyone please submit a ticket here https://feedbackassistant.apple.com/. Apple clearly is ignoring this issue. @bricepollock1 please, please unmarked this as resolved. It is not resolved.
I have removed the <key>com.apple.developer.healthkit.access</key><array/> entry from my entitlement file and the review has passed. However, I'm not sure whether HealthKit works or not. So you can try the workaround if you are urgent to update your apps! Hope Apple can fix it ASAP.
We are getting the same issue for our app submission. Our entitlement files hasn't changed and we have been able to submit the app previously several times successfully.

We are waiting for an Apple approved solution as it appears just simply removing com.apple.developer.healthkit.access will break the healthKit integration, and on other extreme we do not want access to Clinical data.

Please advise

I just submitted a feedback for this and encourage others to do the same. Neither of my apps that use HealthKit can upload and it's been almost a week now.
Does anyone have any ideas to get this raised up to someone @Apple that can address it? (Other than spamming https://feedbackassistant.apple.com/ -- please submit a ticket if you haven't already done so)
I have removed the <key>com.apple.developer.healthkit.access</key><array/> entry from my entitlement file and the review has successfully passed. All the Health Kit features works as expected. But it's a workaround anyway. Filled bug report and wrote to developers support with the bug description too.
Cant believe, one week past, this problem is still unresolved...
Let's see what apple's document says, I absolutely think it a bug from Apple backend.

Discussion
The HealthKit Entitlement provides access to most HealthKit data types. However, because of their highly sensitive nature, some data types require additional entitlements. The HealthKit Capabilities Entitlement provides access to these data types.
To add this entitlement to your app, first enable the HealthKit capability in Xcode, and then check any values that you want to add to the HealthKit Capabilities Entitlement.
Only add values for data types that your app needs to access. App Review may reject apps that don’t use the data appropriately. For more information, see the Health and Health Researchsection of the App Store Review Guidelines.
App Store Distribution fails on valid com.apple.developer.healthkit.access value
 
 
Q