After moving to Xcode 9 with an existing project I’m keep receiving warnings from the Main Thread Checker about a queue called FIRAnalyticsQueue.
I found this MTC as an awesome feature, since I’ve already resolved quite a lot threading issues with it, but unfortunately I’m not able to eliminate the one regarding to Firebase configuration.
The code that I use in the AppDelegate didFinishLaunchingWithOptions function is the following:
if FIRApp.defaultApp() == nil {
FIRApp.configure()
}
And the log that I receives after evaluating the code above:
2017-10-05 16:14:34.965 PonySugarCandyApp[17721] <Error> [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure] to your application initialization.
2017-10-05 16:14:45.283 PonySugarCandyApp[17721] <Notice> [Firebase/Analytics][I-ACS023007] Firebase Analytics v.3700000 started
2017-10-05 16:14:52.139 PonySugarCandyApp[17721] <Notice> [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 17721, TID: 1309471, Thread name: (none), Queue name: FIRAnalyticsQueue, QoS: 9
Backtrace:
4 PonySugarCandyApp 0x000000010c5fe721 __38+[FIRAnalytics createAppDelegateProxy]_block_invoke + 55
5 libdispatch.dylib 0x000000011337143c _dispatch_client_callout + 8
6 libdispatch.dylib 0x00000001133729c7 dispatch_once_f + 297
7 PonySugarCandyApp 0x000000010c5fd519 __47+[FIRAnalytics startWithConfiguration:options:]_block_invoke_2 + 101
8 libdispatch.dylib 0x00000001133703f7 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x000000011337143c _dispatch_client_callout + 8
10 libdispatch.dylib 0x000000011337995b _dispatch_queue_serial_drain + 1162
11 libdispatch.dylib 0x000000011337a2df _dispatch_queue_invoke + 336
12 libdispatch.dylib 0x000000011337d1f9 _dispatch_root_queue_drain + 772
13 libdispatch.dylib 0x000000011337ce97 _dispatch_worker_thread3 + 132
14 libsystem_pthread.dylib 0x00000001138345a2 _pthread_wqthread + 1299
15 libsystem_pthread.dylib 0x000000011383407d start_wqthread + 13
(Recorded stack frame)