当我请求授权时,我将继续收到此错误。
Error Domain=com.apple.healthkit Code=5“事务块失败,没有错误。UserInfo={NSLocalizedDescription=Transaction块失败,没有错误。}
我尝试过重新添加和删除:Privacy - Health Update Usage Description,Privacy - Health Records Usage Description,Privacy - Health Share Usage Description
我已经尝试删除HealthKit权限并再次添加它。这个流程以前起作用了,所以我不知道发生了什么。删除和重新安装应用程序也不能解决这个问题。
HealthKit UI从来没有显示过。检查隐私设置也不表明我曾经请求过。
final class HealthStore {
private let healthStore = HKHealthStore()
func requestAuthorization() {
let objectTypes: Set<HKObjectType> = [
.activitySummaryType()
]
healthStore.requestAuthorization(toShare: nil, read: objectTypes) { (success, error) in
print("success = \(String(describing: success))")
print("error = \(String(describing: error))")
}
}
}在一个示例应用程序中,这段代码工作得很好。我认为HealthKit已经进入了一个糟糕的状态。
发布于 2021-03-07 20:03:50
我不知道潜在的问题,但重新启动我的Mac和我的iPhone解决了问题。
发布于 2021-03-07 21:54:42
你改变你的IP和网络。
https://stackoverflow.com/questions/66520861
复制相似问题