gpt4 book ai didi

healthkit - 在 watchOS 4 Beta 4 中将数据插入 HKWorkoutRouteBuilder 的令人费解的错误

转载 作者:行者123 更新时间:2023-12-04 17:19:40 25 4
gpt4 key购买 nike

当我将路线数据插入 HKWorkoutRouteBuilder 时,我收到以下错误:

与名为 com.apple.healthd.server 的服务的连接被中断,但消息是通过额外的代理发送的,因此该代理无效

这是一个代码片段。

    workoutRouteBuilder.insertRouteData(filteredLocations) { (success, error) in
if !success {
print("inserting route data failed with error: \(String(describing: error))")
}
}

我通过 Speed Sloth 示例的实现进行了模式化。

任何见解都将不胜感激!

更新:以下是观看日志中的更多信息。看起来像是某种权限问题,但我还没有找到它:

fault 13:21:14.664262 -0400 healthd connection from pid 1705: Warning: Exception caught during invocation of received message, dropping incoming message and invalidating the connection. Exception: Invalid parameter not satisfying: [authorizationStatuses count] == [typesIncludingParentTypes count] Invalid parameter not satisfying: [authorizationStatuses count] == [typesIncludingParentTypes count] ( 0 CoreFoundation
0x1dc04d25 + 153 1 libobjc.A.dylib
0x1d227181 objc_exception_throw + 39 2 CoreFoundation
0x1dc04be5 + 1 3 Foundation
0x1e43c1cd + 93 4 HealthDaemon
0x2edf678f + 2015 5 HealthDaemon
0x2ee6eed1 + 143 6 HealthDaemon
0x2ee6ec77 + 143 7 HealthDaemon
0x2ee7b99b + 485 8 HealthDaemon
0x2f0e1e1f + 143 9 Foundation
0x1e589393 + 19 10 Foundation
0x1e587<…>

最佳答案

我遇到了同样的问题。您需要确保向用户请求授权:

// Objective C
[HKSeriesType workoutRouteType]

// Swift
HKSeriesType.workoutRoute()

关于healthkit - 在 watchOS 4 Beta 4 中将数据插入 HKWorkoutRouteBuilder 的令人费解的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45437669/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com