我们正在使用代码在函数中使用CLLocationManager受监视的区域
public func getMonitoredRegions() -> Set<CLRegion> {
return locationManager.monitoredRegions
}
我们正以这种方式使用此功能
for region in locationManager.getMonitoredRegions() where condition(region) {
...
}
我们注意到,使用以下Crashlytics日志调用CLLocationManager MonitoredRegions时,我们的应用程序崩溃了:
#12. Crashed: our.queue.name.here
EXC_BAD_ACCESS KERN_PROTECTION_FAILURE 0x000000016aecffe0
0 libsystem_malloc.dylib 0x191d9bfb4 nanov2_malloc$VARIANT$armv81 + 138
1 libsystem_malloc.dylib 0x191d9c540 nanov2_calloc$VARIANT$armv81 + 136
2 libsystem_malloc.dylib 0x191da9b74 malloc_zone_calloc + 140
3 libsystem_malloc.dylib 0x191daa3fc calloc + 40
4 libobjc.A.dylib 0x1913ac554 class_createInstance + 72
5 libdispatch.dylib 0x191c05ad8 _os_object_alloc_realized + 40
6 libdispatch.dylib 0x191bd9594 <redacted> + 108
7 libdispatch.dylib 0x191bd78ac <redacted> + 1164
8 libdispatch.dylib 0x191bd7ab4 <redacted> + 56
9 libxpc.dylib 0x191e1eeb4 xpc_connection_send_message_with_reply_sync + 204
10 Foundation 0x192d8fa28 <redacted> + 12
11 Foundation 0x192b574dc <redacted> + 3632
12 Foundation 0x192b86eac <redacted> + 144
13 Foundation 0x192d95a28 <redacted> + 72
14 CoreLocation 0x1990cfee8 CLClientCreateIso6709Notation + 53660
15 CoreLocation 0x19907d98c CLClientRetrieveLocationWithDynamicAccuracyReductionAndAlteredAccessoryLocations + 3712
16 CoreLocation 0x19908cda8 CLClientStopVehicleHeadingUpdates + 53876
17 OurCustomLib 0x108e2220c $S18OurCustomLib019LocationManagerCoreD0CAA0dE0A2aDP19getMonitoredRegionsShySo8CLRegionCSo8NSObjectCSH10ObjectiveCg_GyFTWTm + 56
或
#13. Crashed: our.queue.name.here
EXC_BAD_ACCESS KERN_PROTECTION_FAILURE 0x000000016fc93fe0
0 libsystem_malloc.dylib 0x18d659fb0 nanov2_allocate$VARIANT$armv81 + 138
1 libsystem_malloc.dylib 0x18d65a53c nanov2_calloc$VARIANT$armv81 + 136
2 libsystem_malloc.dylib 0x18d667b70 malloc_zone_calloc + 140
3 libsystem_malloc.dylib 0x18d6683f8 calloc + 40
4 libobjc.A.dylib 0x18cc68554 class_createInstance + 72
5 libdispatch.dylib 0x18d4c3ad8 _os_object_alloc_realized + 40
6 libdispatch.dylib 0x18d497594 dispatch_mach_msg_create$VARIANT$armv81 + 108
7 libdispatch.dylib 0x18d4958c8 _dispatch_mach_send_and_wait_for_reply + 1164
8 libdispatch.dylib 0x18d495ad0 dispatch_mach_send_with_result_and_wait_for_reply$VARIANT$armv81 + 56
9 libxpc.dylib 0x18d6dceb4 xpc_connection_send_message_with_reply_sync + 204
10 Foundation 0x18e64cc28 __NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__ + 12
11 Foundation 0x18e41477c -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 3632
12 Foundation 0x18e44414c -[NSXPCConnection _sendSelector:withProxy:arg1:arg2:arg3:] + 144
13 Foundation 0x18e652c28 _NSXPCDistantObjectSimpleMessageSend3 + 72
14 CoreLocation 0x194955f18 CLClientCreateIso6709Notation + 53660
15 CoreLocation 0x194903a38 CLClientRetrieveLocationWithDynamicAccuracyReductionAndAlteredAccessoryLocations + 3712
16 CoreLocation 0x194912e54 CLClientStopVehicleHeadingUpdates + 53876
17 OurCustomLib 0x108e2220c $S18OurCustomLib019LocationManagerCoreD0CAA0dE0A2aDP19getMonitoredRegionsShySo8CLRegionCSo8NSObjectCSH10ObjectiveCg_GyFTWTm + 56
代码位于框架内,应用程序使用该框架。
框架代码在Swift 4.0中。所有发生此崩溃的设备都在iOS 12上。
在iOS 12上使用CLLocationManager monitoredRegions 时,是否还有其他人遇到问题?
请告知