【发布时间】:2021-05-12 19:49:20
【问题描述】:
我在应用程序的“示例”字段中使用了代码。这个“示例”在我的 Android 设备上完美运行,当我按下 iOS 设备上的读取按钮时,应用程序失败并关闭应用程序。
我使用的包: https://pub.dev/packages/fit_kit
当我点击阅读按钮时,我得到这个错误:
*** First throw call stack:
(
0 CoreFoundation 0x00007fff20421af6 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff20177e78 objc_exception_throw + 48
2 CoreFoundation 0x00007fff204219d4 -[NSException initWithCoder:] + 0
3 HealthKit 0x00007fff36033520 -[HKHealthStore _validateHealthDataPurposeStringsForSharingTypes:readingTypes:isResearchStudy:] + 931
4 HealthKit 0x00007fff36032e98 -[HKHealthStore _validatePurposeStringsForSharingTypes:readingTypes:] + 379
5 HealthKit 0x00007fff3603268c -[HKHealthStore requestAuthorizationToShareTypes:readTypes:shouldPrompt:completion:] + 354
6 HealthKit 0x00007fff360323f8 -[HKHealthStore requestAuthorizationToShareTypes:readT<…>
Lost connection to device.
我该怎么办?
【问题讨论】:
-
编辑 .xcodeproj 的 info.plist:developer.apple.com/documentation/bundleresources/…
-
我已经将这些设置添加到我的 info.plist 文件中,但仍然出现此错误。