如何调试此 Xcode 堆栈跟踪

How to debug this Xcode stacktrace

Flutter 应用程序在 <1% 的设备(所有版本和型号)上请求通过包(health_kit_reporter 和 HealthKitReporter)写入 Apple Health 的授权时发生崩溃。

Last Exception Backtrace:
0   CoreFoundation                  0x1add0d9d4 __exceptionPreprocess + 216 (NSException.m:199)
1   libobjc.A.dylib                 0x1c16beb54 objc_exception_throw + 56 (objc-exception.mm:565)
2   CoreFoundation                  0x1adc1c4fc +[NSException raise:format:arguments:] + 96 (NSException.m:146)
3   Foundation                      0x1aef14878 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 128 (NSException.m:231)
4   Flutter                         0x10585c82c -[FlutterStandardMethodCodec encodeErrorEnvelope:] + 196 (FlutterStandardCodec.mm:110)
5   Flutter                         0x1058597c8 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke_2 + 136 (FlutterChannels.mm:0)
6   health_kit_reporter             0x105152cbc thunk for @escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> () + 92 (<compiler-generated>:0)
7   health_kit_reporter             0x105161c2c closure #1 in SwiftHealthKitReporterPlugin.requestAuthorization(reporter:arguments:result:) + 320
8   health_kit_reporter             0x10516ca14 partial apply for closure #1 in SwiftHealthKitReporterPlugin.requestAuthorization(reporter:arguments:result:) + 72 (<compiler-generated>:0)
9   HealthKitReporter               0x104dd875c thunk for @escaping @callee_guaranteed (@unowned Bool, @guaranteed Error?) -> () + 56 (<compiler-generated>:0)
10  HealthKit                       0x1b7f9d21c __84-[HKHealthStore requestAuthorizationToShareTypes:readTypes:shouldPrompt:completion:]_block_invoke + 368 (HKHealthStore.m:688)
11  libdispatch.dylib               0x1ad945298 _dispatch_call_block_and_release + 24 (init.c:1454)
12  libdispatch.dylib               0x1ad946280 _dispatch_client_callout + 16 (object.m:559)
13  libdispatch.dylib               0x1ad8eedcc _dispatch_lane_serial_drain$VARIANT$mp + 612 (inline_internal.h:2548)
14  libdispatch.dylib               0x1ad8ef8d8 _dispatch_lane_invoke$VARIANT$mp + 472 (queue.c:3862)
15  libdispatch.dylib               0x1ad8f9338 _dispatch_workloop_worker_thread + 712 (queue.c:6601)
16  libsystem_pthread.dylib         0x1f43aa5a4 _pthread_wqthread + 272 (pthread.c:2206)
17  libsystem_pthread.dylib         0x1f43ad874 start_wqthread + 8

有没有关于崩溃原因的信息? 或者在使用 Xcode?

调试期间是否有重现错误的技巧

我在我的应用程序中偶然发现了这个错误。我还没有验证这一点,但看起来这个问题是由 call in encodeErrorEnvelope 引起的,它试图写入错误细节,如果这样的错误细节不可编码,它会使应用程序崩溃。

此错误已通过此处的更改得到修复: https://github.com/VictorKachalov/health_kit_reporter/pull/25/files