首页 > 解决方案 > iOS - Objective-C:库升级后 iOS 10 上的应用程序崩溃

问题描述

我最近升级了一个较旧的Objective-C应用程序以添加新功能。我现在使用的是AFNetworking4.0 版。iOS即使在最新版本的except on中,一切现在都可以正常工作iOS 10。当我在模拟器上运行它时,应用程序立即在splashSreen. 从日志中我知道它与NSURLSession但无法弄清楚如何解决它有关。我发现了类似的问题,但解决方案不是最新的。

这就是我在thread stack坠机发生时所拥有的

在此处输入图像描述

在此处输入图像描述

这是控制台日志中的崩溃描述以及之前的一些Firebase调用:

2020-11-19 18:48:11.257 myApp[63563:2715840] Appdelegate, applicationDidBecomeActive 
Nov 19 18:48:11  myApp[63563] <Warning>: 6.34.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement 
Nov 19 18:48:11  myApp[63563] <Notice>: 6.34.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled 
Nov 19 18:48:11  myApp[63563] <Notice>: 6.34.0 - [Firebase/Analytics][I-ACS023220] Analytics screen reporting is enabled. Call +[FIRAnalytics logEventWithName:FIREventScreenView parameters:] to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist 
2020-11-19 18:48:11.645 myApp[63563:2715921] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7fa48d318df0 of class __NSCFLocalDataTask was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x600000031ce0> ( <NSKeyValueObservance 0x60000024a200: Observer: 0x6080000f5980, Key path: state, Options: <New: NO, Old: NO, Prior: NO> Context: 0x0, Property: 0x608000253ad0> )'
        *** First throw call stack: (   
1 libobjc.A.dylib 0x0000000112558141 objc_exception_throw + 48 
2 CoreFoundation 0x0000000112b5c625 +[NSException raise:format:] + 197 
3 Foundation 0x000000010fb52b53 NSKVODeallocate + 294 
4 libobjc.A.dylib 0x000000011256cb8e _ZN11objc_object17sidetable_releaseEb + 202 
5 libsystem_blocks.dylib 0x0000000113ff799d _Block_release + 111 
6 libdispatch.dylib 0x0000000113f6405c _dispatch_client_callout + 8 
7 libdispatch.dylib 0x0000000113f40c6e _dispatch_continuation_pop + 1020 
8 libdispatch.dylib 0x0000000113f4e5db _dispatch_source_invoke + 1401 
9 libdispatch.dylib 0x0000000113f42c47 _dispatch_queue_serial_drain + 981 
10 libdispatch.dylib 0x0000000113f43669 _dispatch_queue_invoke + 1084 
11 libdispatch.dylib 0x0000000113f45ec4 _dispatch_root_queue_drain + 634 
12 libdispatch.dylib 0x0000000113f45bef _dispatch_worker_thread3 + 123 
13 libsystem_pthread.dylib 0x000000011430d6d5 _pthread_wqthread + 220 
14 libsystem_pthread.dylib 0x000000011430d57b start_wqthread + 15 ) libc++abi.dylib: terminating with uncaught exception of type NSException

标签: iosobjective-cafnetworkingnsurlsession

解决方案


推荐阅读