使用HealthKit莫名崩溃

今天在测试自己写的框架,[JYAuthorizationManager](www.baidu.com),然后在测试`HealthKit`权限的时候老是莫名的闪退,下面是系统的log:

1
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSHealthShareUsageDescription must be set in the app's Info.plist in order to request read authorization for the following types: HKQuantityTypeIdentifierStepCount'
原因指的是plist文件里面没有加权限描述,但其实我已经加过了。于是各种找原因,才发现了解决方法: > 健康的权限描述里面不能有*中文*。我也是醉了。。。

! HealthKit的权限描述

参考:https://www.jianshu.com/p/780521c34de9

作者

千行

发布于

2019-03-13

更新于

2022-10-21

许可协议

评论