Running my suite of XCUITests using Xcode 9 running on iOS 11.
Tests all run perfect in Xcode 8 (iOS10), but in Xcode 9 I get the following error:
Main Thread Checker: UI API called on background thread [UIApplication statusBarOrientation]...
... Queue name: com.Flurry.Analytics.Session
This can be fixed by commenting out all the Flurry code, but that is obviously not ideal. This issue has been seen by devs previously: https://github.com/flurry/flurry-ios-sdk/issues/91
However, in this case, the dev build compiles all correctly and this error only occurs when XCUITests are run.
Anyone know how to fix this?
To avoid crash in test you have to uncheck
Main Thread Checker
in your SchemeGo
Product > Scheme > Manage Schemes
search the Scheme you use for your tests and pressEdit...
in the left sidebar pressTest
and then go toDiagnostics
and uncheckMain Thread Checker
checkboxAnd try again
This is a temporal solution and you should try to avoid call UI API on background threads because the app could behave weirdly. But since you use third-party library you should wait until they fix it.