什么是 FNFPlayer?它从后台线程访问 UIApplication applicationState

What is FNFPlayer? It accesses UIApplication applicationState from background thread

我经常在 iOS 11 (xcode 9):

收到这些警告
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 988, TID: 338692, Thread name: fnf player thread, Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   hairzapp                            0x0000000103a35634 -[FNFPlayerLayer _preventPlayback] + 60
5   hairzapp                            0x0000000103a33f30 -[FNFPlayerLayer _resetGLContext] + 36
6   hairzapp                            0x0000000103a129cc __35-[FNFRenderingThread dispatchSync:]_block_invoke + 28
7   hairzapp                            0x0000000103a128a8 __35-[FNFRenderingThread performBlock:]_block_invoke + 36
8   CoreFoundation                      0x00000001848fa0fc <redacted> + 20
9   CoreFoundation                      0x00000001848f99cc <redacted> + 288
10  CoreFoundation                      0x00000001848f7c34 <redacted> + 2436
11  CoreFoundation                      0x0000000184817fb8 CFRunLoopRunSpecific + 436
12  CoreFoundation                      0x0000000184867098 CFRunLoopRun + 116
13  hairzapp                            0x0000000103a12ba4 -[FNFRenderingThread main] + 204
14  Foundation                          0x0000000185342860 <redacted> + 996
15  libsystem_pthread.dylib             0x000000018457c31c <redacted> + 308
16  libsystem_pthread.dylib             0x000000018457c1e8 <redacted> + 0
17  libsystem_pthread.dylib             0x000000018457ac28 thread_start + 4
2017-11-28 22:33:33.895582+0100 hairzapp[988:338692] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 988, TID: 338692, Thread name: fnf player thread, Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   hairzapp                            0x0000000103a35634 -[FNFPlayerLayer _preventPlayback] + 60
5   hairzapp                            0x0000000103a33f30 -[FNFPlayerLayer _resetGLContext] + 36
6   hairzapp                            0x0000000103a129cc __35-[FNFRenderingThread dispatchSync:]_block_invoke + 28
7   hairzapp                            0x0000000103a128a8 __35-[FNFRenderingThread performBlock:]_block_invoke + 36
8   CoreFoundation                      0x00000001848fa0fc <redacted> + 20
9   CoreFoundation                      0x00000001848f99cc <redacted> + 288
10  CoreFoundation                      0x00000001848f7c34 <redacted> + 2436
11  CoreFoundation                      0x0000000184817fb8 CFRunLoopRunSpecific + 436
12  CoreFoundation                      0x0000000184867098 CFRunLoopRun + 116
13  hairzapp                            0x0000000103a12ba4 -[FNFRenderingThread main] + 204
14  Foundation                          0x0000000185342860 <redacted> + 996
15  libsystem_pthread.dylib             0x000000018457c31c <redacted> + 308
16  libsystem_pthread.dylib             0x000000018457c1e8 <redacted> + 0
17  libsystem_pthread.dylib             0x000000018457ac28 thread_start + 4

你能帮我找到来源吗?我猜它一定是我使用的库之一,因为在我的代码中只有很少的调用[UIApplication applicationState]

pod 'objective-zip', '1.0.3'
pod 'Google-Mobile-Ads-SDK'
pod 'AppLovinSDK'
pod 'AdColony'
pod 'GoogleMobileAdsMediationAppLovin'
pod 'GoogleMobileAdsMediationAdColony'
pod 'GoogleAnalytics'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'FBAudienceNetwork', '4.25.0'
pod 'GoogleConversionTracking'
pod 'Fabric'
pod 'Crashlytics'
pod 'AFNetworking'
pod 'AFNetworkActivityLogger', :git => 'https://github.com/AFNetworking/AFNetworkActivityLogger.git', :branch => '3_0_0'
pod 'iRate'
pod 'Firebase/Core'
pod 'Firebase/Messaging' 
pod 'MBProgressHUD'
pod 'Realm'
pod 'UICollectionViewLeftAlignedLayout'
pod 'OpenCV'
pod 'SCLAlertView-Objective-C'
pod 'CMPopTipView'

如果有人能给我提示如何找到坏库,我会很高兴。

我猜它有 Facebook SDK 个根。
GitHub 上发现 Instagramm class-dump,看起来像一些私有的 class。 https://github.com/RishabSwift/InstagramHeaders/blob/master/FNFPlayerLayer.h

- (_Bool)_preventPlayback;    

还在此处找到 FNFPlayerLayer "breadcrumbs":
https://github.com/facebook/infer/blob/master/infer/tests/codetoanalyze/objc/ioslints/unavailable_property_ios.m

可能它来自FBAudienceNetwork框架,你可以尝试从你的Podfile中删除它,然后制作pod install并再次分析控制台日志。