Monday, November 13, 2017

Avoid main thread check warning in iOS project when firebase is used

When starting ios project which integrated with Google Firebase library, the app may generate few main thread check warning as below
Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 740, TID: 51958, Thread name: (none), Queue name: FIRAnalyticsQueue, QoS: 9
Backtrace:
In addition, the ios unit test target may not be able to run at all if the main thread warning exists.

The reason is the old Google Firebase library 4.0.0 and below has not been updated for the new ios 11 and xcode 9, the issue can be fixed by updating the Google Firebase library through the pod file by running the below command from ios project root folder in mac terminal:

pod update

Currently it will update the Google Firebase library to
Installing Firebase 4.5.0 (was 4.0.0)
Installing FirebaseAnalytics 4.0.4 (was 4.0.0)
Installing FirebaseCore 4.0.10 (was 4.0.0)
Installing FirebaseInstanceID 2.0.5 (was 2.0.0)
Installing Google-Mobile-Ads-SDK 7.25.0 (was 7.20.0)
Installing GoogleToolboxForMac 2.1.3 (was 2.1.1)

Installing nanopb (0.3.8)

No comments:

Post a Comment