Reputation: 4594
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?
Upvotes: 2
Views: 1556
Reputation: 309
To avoid crash in test you have to uncheck Main Thread Checker
in your Scheme
Go Product > Scheme > Manage Schemes
search the Scheme you use for your tests and press Edit...
in the left sidebar press Test
and then go to Diagnostics
and uncheck Main Thread Checker
checkbox
And 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.
Upvotes: 4