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

依然范特西╮ 提交于 2019-12-08 01:39:15

问题


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?


回答1:


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.




回答2:


This was an iOS bug and has been fixed in iOS 9.3 beta 2. Developers can download the beta build from https://developer.apple.com/ios/download/ or wait until the 9.3 update is released to everyone.



来源:https://stackoverflow.com/questions/33923541/error-in-healthkit-error-domain-com-apple-healthkit-code-100-failed-to-open-da

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!