Sorry you’re having trouble with the Healthkit chapter! I think what’s happening is that you opened the Final project instead of the Starter project. If you Build and Run the starter project, you should get a working version of a watchOS app that simply implements an interval timer.
The errors you show above suggests that the HealthKit capability has been enabled; which should only be the case in the Final project. If you want to see the Final project running using HealthKit without walking through all the steps outlined in the chapter, you will need to do the first step of the Provisioning for HealthKit section of the chapter.
Select the Groundhog project from the project navigator and then select the Groundhog project in the editor. Select the Build Settings tab and scroll to the very bottom. You’ll see a user-defined variable named
W3T_BUNDLE_PREFIX. Select the existing value and enter your own. Any string will do, but generally, it’s best to use your domain in reverse order.
This will change the bundle identifiers for each target in the project so that they use your own prefix, making them unique.
You may also, then, have to switch the team for each project, but it is generally not necessary.
Finally, please note:
To provision your app correctly and use HealthKit, you must have a valid Apple Developer account. If you don’t have a valid account, the HealthKit permission requests will fail.
If you have any other questions, feel free to reply, and I’ll see if I can help you out.
Thanks for reading!