Xcode HealthKit com.apple.developer.healthkit.access entitlements warning just started appearing

I've got a couple of projects that use HealthKit (that were building without this warning, just fine, for months) that are both suddenly generating the following warning when building against a device or the Generic iOS Device:


Code Signing Warning: Provisioning profile "iOS Team Provisioning Profile: com.xxx.xxx" for "XXX" contains entitlements that aren't in the entitlements file: com.apple.developer.healthkit.access. To use these entitlements, add them to your entitlements file. Otherwise, remove unused entitlements from your provisioning profile.


HealthKit is enabled in the Capabilities, linked in the project, and has been for some time (and I've checked the .entitlements file, it's enabled). The AppID also has HealthKit enabled, I've checked it on the developer portal. There are no other build warnings or errors. This issue just happened out of the blue, never had any build issues with HealthKit in the project before.


I tried turning off the "Automatically manage signing" setting on the project, then enabling it again. I've tried clearing all the .mobileprovision profiles from /Library/MobileDevices/Provisioning Profiles, etc .Nothing works.


It looks to me like the provisioning profile has some new key called "com.apple.developer.healthkit.access" and Xcode isn't finding that dependency during its check, because what's in the .entitlements file is a key called "com.apple.developer.healthkit".


Anyway, I cannot get rid of this warning, any help would be appreciated. Anybody else seen this issue?

I'm not sure about the HealthKit case, but if HealthKit has a permission that must be explicitly requested on the developer portal, and it's like other similar scenarios, then you should turn OFF automatic code signing — Xcode may not be able to coordinate all the pieces when automatic code signing is turned on. This is a change in a recent version of Xcode, where it started complaining (the warning you see) because earlier versions weren't always doing the right thing.


Assuming you created and downloaded the Health-Kit-enabled provisioning profile already, then you need to do three manual things in Xcode:


1. Set the code signing manually, including choosing the custom provisioning profile.


2. Turn on the relevant capability in the Capabilities tab of the target editor page.


3. Create the appropriate entitlements key.


It sounds like you've done everything except turning off automatic code signing (and leaving it off), and choosing the provisioning profile manually.


At any rate, give that a try and see if it solves your problem. (As I say, I haven't used HealthKit, so I'm not sure I've got the right end of the stick here.)


Also, I suggest you also submit a bug report asking for Xcode to be enhanced to be capable of handling the special provisioning profile automatically, which would allow automatic code signing to work again, for apps like yours.

I'm hitting this issue as well, I tried to manually add com.apple.developer.healthkit.access with a value of "True" to the entitlements file but just get an error that it doesn't match what's in the profile. Have you had any luck fixing the issue?

"True" doesn't sound like a legal value for this. If the value is supposed to be Boolean, then you need to make sure that the plist entry is set to that value type (right-click on the Type column value, and choose Boolean), and the possible values will show as YES or NO.


I think that new plist keys default to String value types, so you've probably given it the literal string "True".

My mistake, I was thinking Boolean and I just typed out "True", I did set it to "Yes" and the type to Boolean and had no luck unfortunately

I just tried turning on HealthKit capability in Xcode, knowing it wouldn't work, to see what it put in the entitlements. In the file it created, there were two entries, one with key "com.apple.developer.healthkit" with a Boolean value YES, the other with key "com.apple.developer.healthkit.access" with type Array (and no entries). I suspect that's the correct structure here.


But, as I said before, I'm fumbling in the dark here.

That's a great idea, I'm going to try to create a new project with a new app id and profile that has health kit enabled and see if that array gets populated with anything


Thanks!

Hey Rajusa, did you found anything? I m facing to the same issue...

Adding "com.apple.developer.healthkit.access" to your entitlements file with type array does get rid of the warning. I haven't had a chance to create a new project and see if that array gets populated with anything

Xcode HealthKit com.apple.developer.healthkit.access entitlements warning just started appearing
 
 
Q