Xcode 9, iOS 11, XCUITest failure: Main Thread Checker Flurry Analytics

北城以北 提交于 2019-12-08 00:25:42

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/46360291/xcode-9-ios-11-xcuitest-failure-main-thread-checker-flurry-analytics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!