简体   繁体   中英

Error in HealthKit: Error Domain=com.apple.healthkit Code=100 “Failed to open database” UserInfo= {NSLocalizedDescription=Failed to open database}

We're getting an error on a certain few devices when trying to authorize with the HealthKit API. The call to [HKHealthStore requestAuthorizationToShareTypes:::] fails consistently with the following error and the system-generated "Allow access to Health App" modal never gets presented:

Error Domain=com.apple.healthkit Code=100 "Failed to open database" UserInfo= {NSLocalizedDescription=Failed to open database}

We have a device that is able to reproduce this consistently, even after force quitting apps and restarting the OS. The phone seems to be unable to connect to HealthKit from any and all 3rd-party apps so it seems like a bug in HealthKit, not on our side. This seems to happen only on certain devices, but there doesn't seem to be anything special about the devices (all iPhones 4s and higher running iOS 9, 9.0.1, 9.0.2, or 9.1)

My question is: Has anyone else seen this error and if so what did you do to fix or mitigate the problem?

I've got a response from Apple in my bug report ticket (for the case when device reboot fixes the problem):

The workaround is to reboot the device. A developer cannot directly work around the problem.

这是一个iOS错误,已在iOS 9.3 beta 2中修复。开发人员可以从https://developer.apple.com/ios/download/下载Beta版本,也可以等待9.3更新发布给所有人。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM