How to get permissions to Motion & Fitness

I am trying to access the CMAltimeter class, and I keep getting the error Domain=CMErrorDomain Code=105.

I know that indicates my app does not have permissions for motion and fitness. All the documentation I can find mentions the need to add NSMotionUsageDescription to Info.plist. However, I have done that, and it does not help.

I am using Xcode 15. It seems that whenever I go to look up how to get permissions to something, the information on the web seems to be outdated, and Apple seems to move stuff around. I have found I can add the entry to Info.plist by using the Info.plist editor and selecting "Privacy - Motion Usage Description", but that does not help.

I also notice that when I info tab on my build target, there is a "Privacy - Motion Usage Description" there also. If I add the entry there, it takes out out of my Info.plist, and makes an entry in the project's project.pbxproj file named INFOPLIST_KEY_NSMotionUsageDescription.

Regardless of which of those I use, I still do not the 105 error. I'm sure I'm missing something more, but I can't find it anywhere. There was mention of a "Health and Fitness" in the signing capabilities, but I could not find anything listed there in Xcode 15

Well, as I was sitting here working on something different, my phone decided to update itself to 17.5.1. Once that was done, my app started working!? I had done one clear already, so I'm guessing it was the iOS version?

In any event, it now works. The entry on the info tab of the build target (the one that creates the INFOPLIST_KEY_NSMotionUsageDescription) seems to be the "new" way of doing it. Xcode removed the entry I made in Info.plist

EDIT - I had done one "clean" on the project prior to the update, but that did not seem to help

So, I just bounced my project off GitHub to a colleague's computer. I verified he is on 17.5.1. We built on Xcode on his machine, and on his phone, he is not getting the permission again. We did another "clean", but it didn't help. What can I check to make sure the permissions are making it to builds done on his machine?

How to get permissions to Motion & Fitness
 
 
Q