Error attempting to start HealthKit query from watchOS 2

I'm on the latest Xcode (7A121I) and trying to get HealthKit to run in the simulators (watchOS2 / iOS 9). But when I request auth to HK (requestAuthorizationToShareTypes:), even though the iOS app displays the HK permissions and I grant them, the callback on the watch extension spits out:


Error Domain=NSCocoaErrorDomain Code=4097 "Couldn’t communicate with a helper application." (connection to service named com.apple.healthd.server) UserInfo=0x7be506d0 {NSDebugDescription=connection to service named com.apple.healthd.server


Any ideas as to what's going on?

I'd also love to know the answer to this. Very frustrating. It works intermittently for me...

Actually, the thing that was holding me up was that I forgot to add the proper calls to the Main App's delegate. Add something like this:



let healthStore = HKHealthStore()

func applicationShouldRequestHealthAuthorization(application: UIApplication) {

healthStore.handleAuthorizationForExtensionWithCompletion { success, error in

}

}


This fixed my issue...

Error attempting to start HealthKit query from watchOS 2
 
 
Q