0

I have an older Objective-C application that I upgraded recently in order to add new functionalities. I'm using now AFNetworking version 4.0. All is working now even in the newest version of iOS except on iOS 10. When I run it on the simulator, the application crash immediately in the splashSreen. From the logs I know that it's in relation with NSURLSession but can't figure out how to solve it. I've found similar issues but there solutions are not up-to-date.

This is what I have in the thread stack when the crash happened

enter image description here

enter image description here

And this is the crash description from the console log with some previous Firebase calls:

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
koen
  • 5,383
  • 7
  • 50
  • 89
Ne AS
  • 1,490
  • 3
  • 26
  • 58
  • Looks like a Firebase issue, not AFNetworking: https://github.com/firebase/firebase-ios-sdk/issues/6782 – koen Nov 19 '20 at 18:31
  • @koen thank you. I edited the title and I will check this – Ne AS Nov 19 '20 at 18:41
  • 1
    Try to catch it using Exception Breakpoint – Vadim Zhuk Nov 19 '20 at 20:00
  • @VadimZhuk this is what I get: Thread 3 Queue : com.apple.root.default-qos.overcommit (concurrent). libobjc.A.dylib`objc_exception_throw: -> 0x104422111 <+0>: pushq %rbp. And the last log in the console is: : 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 – Ne AS Nov 19 '20 at 20:31
  • On what line does it crash? See also here: https://stackoverflow.com/questions/17802662/how-to-add-exception-breakpoint-in-xcode – koen Nov 19 '20 at 20:54
  • @koen the crash is not on a specific line. It seems like there is a problem with Firebase performance. When I remove the performance pod, the app worked fine. It's not a good solution because I need the performance in the firebase console but still now I didn't find any other solution. See here: https://github.com/firebase/firebase-ios-sdk/issues/6782 – Ne AS Nov 20 '20 at 08:19

0 Answers0