Our app seems to be getting rejected by Apple with the following reasons.
Guideline 2.5.1 - Performance - Software Requirements
We continued to notice that your app uses the Clinical Health Records API but your app does not appear to include any primary features that require the Clinical Health Records API.
Next Steps
To resolve this issue, please remove the Clinical Health Records API from your app. To disable the functionality through App Store Connect, please uncheck the “Health Records” capability (leaving the HealthKit entitlement enabled), remove all the references to HKClinicalRecord class from your code, then resubmit.
To obtain support on how to best address technical issues, it may be appropriate to contact Developer Technical Support, who can provide discrete code-level assistance.
To ensure the Support engineers can best help you, be sure to prepare any available symbolicated crash logs, screenshots, or steps to reproduce the issues encountered in your request.
Guideline 2.5.1 - Performance - Software Requirements
Your app uses the Clinical Health Records API but your app does not appear to include any primary features that require the Clinical Health Records API.
Next Steps
To resolve this issue, please remove the Clinical Health Records API from your app, as well as any references to this app’s interactivity with Clinical Health Records from your app or its metadata.
To disable the functionality through App Store Connect, please uncheck the "Health Records" capability (leaving the HealthKit entitlement enabled), remove all the references to HKClinicalRecord class from your code, then resubmit.
This is confusing since we looked at our project and the entitlements file and the clinical records capability within HealthKit isn't turned on, see the combined images below.
To take this one step further we even did the following command using the terminal within the project. grep -r "clinical" . && grep -r "HKClinical" . && grep -r "HKClinicalRecord" . To see if there was any reference to the clinical records in the project or 3rd party libraries. And this returns no results either. This was all confusing but finally we decided to inspect the final ipa that gets produced when the project is archived and we discovered this within the embedded.provision file within the payload. And we discovered the following.
<key>com.apple.developer.healthkit.access</key>
<array>
<string>health-records</string>
</array>
So then we discovered that this key was being added into the final ipa automatically somewhere which was even more confusing, so we checked throughout the project again until I realised that this may be being added in via the provisioning profiles. So we created a fresh provisioning profile within Apple Developer and inspected the contents of it and discovered that this is where this health-records key is being added in automatically.
But on Apple Developer or App Store Connect, there is currently no way to disable this and it is something that gets added in automatically. Below are some images of Apple Developers Health Kit capabilities not allowing you to toggle health-records on or off anywhere.
How can I prevent my provisioning profile from automatically having this health records capability? I've even tried sample projects with HealthKit i.e https://www.raywenderlich.com/459-healthkit-tutorial-with-swift-getting-started and it even gets automatically generated in this sample from Ray Wenderlich. It seems like Apple have tied this functionality into provisioning profiles but will reject your app for including this...it makes no sense.


