bytedance / Bytedance-UnionAD

MIT License
171 stars 53 forks source link

反馈一个UI线程问题 #85

Closed jabez1314 closed 4 years ago

jabez1314 commented 4 years ago

提示: UI API called from background thread [UIButton setSelected:] must be used from main thread only.

[BU_ZFPlayerControlView buzf_playerPlayBtnState:]

zengyangyang commented 4 years ago

您好,您是否可以提供详细的堆栈情况,便于我们确认此问题。十分感谢。

jabez1314 commented 4 years ago

好的, 等遇到后会提供更多信息

jabez1314 commented 4 years ago

================================================================= Main Thread Checker: UI API called on a background thread: -[UIButton setSelected:] PID: 9244, TID: 2551787, Thread name: AVAudioSession Notify Thread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0 Backtrace: 4 Target 0x000000010577d0d8 -[BU_ZFPlayerControlView buzf_playerPlayBtnState:] + 68 5 Target 0x0000000105742cf4 -[BU_ZFPlayerView play] + 56 6 Target 0x00000001057442f4 -[BU_ZFPlayerView audioRouteChangeListenerCallback:] + 144 7 CoreFoundation 0x000000019d4f5504 E2D6A76B-6879-31A3-8168-DF49F94E17CD + 550148 8 CoreFoundation 0x000000019d4f554c E2D6A76B-6879-31A3-8168-DF49F94E17CD + 550220 9 CoreFoundation 0x000000019d4f48a4 E2D6A76B-6879-31A3-8168-DF49F94E17CD + 546980 10 CoreFoundation 0x000000019d4f457c E2D6A76B-6879-31A3-8168-DF49F94E17CD + 546172 11 CoreFoundation 0x000000019d4712d4 E2D6A76B-6879-31A3-8168-DF49F94E17CD + 8916

Eason-yangyang commented 4 years ago

十分感谢您的反馈,我们将尽快修复此问题。

Murphy-zhu commented 2 years ago

[UIImageView _invalidateImageLayouts] must be called on the main queue

AppLovin 调用 AppLovinMediationByteDanceAdapter 的时候会崩溃。显示UI更新不在主线程。但是调用的方法是SDK中的,外面没办法修改。还是说有什么别的方式。

Thread 20 Queue : NSOperationQueue 0x107011fd0 (QOS: UNSPECIFIED) (concurrent)

0 0x00000001066a3a8c in _dispatch_assert_queue_fail ()

1 0x00000001066a3a1c in dispatch_assert_queue ()

2 0x00000001848595d0 in -[UIImageView _mainQ_beginLoadingIfApplicable] ()

3 0x0000000184857994 in -[UIImageView setHidden:] ()

4 0x0000000184674c4c in -[UIButtonLegacyVisualProvider _updateBackgroundImageView] ()

5 0x0000000184b1d1e0 in -[UIButtonLegacyVisualProvider layoutSubviews] ()

6 0x0000000184816674 in -[UIButton layoutSubviews] ()

7 0x00000001847e7964 in -[UIView(CALayerDelegate) layoutSublayersOfLayer:] ()

8 0x0000000185e59b6c in CA::Layer::layout_if_needed(CA::Transaction*) ()

9 0x0000000184849a74 in -[UIView(Hierarchy) layoutBelowIfNeeded] ()

10 0x0000000184afe69c in -[UIButtonLegacyVisualProvider imageViewCreateIfNeeded:] ()

11 0x00000001849503f8 in -[UIButton imageView] ()

12 0x00000001052ed004 in -[BUVideoAdView playButton] at /var/folders/lg/33pj_plj2r563jbng94gj8yc0000hd/T/cocoapods-am1ojdlj/Pods/BUAdSDK/BUAdSDK/BUAdSDK/BUAdSDK/Placeholder/Native/VideoAd/Public/BUVideoAdView.m:722

13 0x00000001052ed408 in -[BUVideoAdView player] at /var/folders/lg/33pj_plj2r563jbng94gj8yc0000hd/T/cocoapods-am1ojdlj/Pods/BUAdSDK/BUAdSDK/BUAdSDK/BUAdSDK/Placeholder/Native/VideoAd/Public/BUVideoAdView.m:746

14 0x00000001052ea1dc in -[BUVideoAdView initWithMaterial:] at /var/folders/lg/33pj_plj2r563jbng94gj8yc0000hd/T/cocoapods-am1ojdlj/Pods/BUAdSDK/BUAdSDK/BUAdSDK/BUAdSDK/Placeholder/Native/VideoAd/Public/BUVideoAdView.m:153

15 0x00000001052ea5f0 in -[BUVideoAdView init] at /var/folders/lg/33pj_plj2r563jbng94gj8yc0000hd/T/cocoapods-am1ojdlj/Pods/BUAdSDK/BUAdSDK/BUAdSDK/BUAdSDK/Placeholder/Native/VideoAd/Public/BUVideoAdView.m:224

16 0x00000001051e7b80 in -[BUNativeAdRelatedView videoAdView] at /var/folders/lg/33pj_plj2r563jbng94gj8yc0000hd/T/cocoapods-am1ojdlj/Pods/BUAdSDK/BUAdSDK/BUAdSDK/BUAdSDK/Placeholder/Native/Public/BUNativeAdRelatedView.m:157

17 0x0000000104d496b4 in -[ALByteDanceNativeAdDelegate nativeAdsManagerSuccessToLoad:nativeAds:] at /usr/local/var/jenkins/workspace/Mobile-iOS-Adapter/iOS-SDK-Mediation-Adapters/ByteDance/ByteDanceAdapter/ALByteDanceMediationAdapter.m:993

18 0x00000001051ea428 in -[BUNativeAdsManager safeDelegate_nativeAdsManagerSuccessToLoad:nativeAds:isMopub:] at /var/folders/lg/33pj_plj2r563jbng94gj8yc0000hd/T/cocoapods-am1ojdlj/Pods/BUAdSDK/BUAdSDK/BUAdSDK/BUAdSDK/Placeholder/Native/Public/BUNativeAdsManager.m:318

19 0x00000001051e9d80 in __56-[BUNativeAdsManager setMopubAdMarkUp:successLoadVideo:]_block_invoke at /var/folders/lg/33pj_plj2r563jbng94gj8yc0000hd/T/cocoapods-am1ojdlj/Pods/BUAdSDK/BUAdSDK/BUAdSDK/BUAdSDK/Placeholder/Native/Public/BUNativeAdsManager.m:190

20 0x00000001051e98fc in -[BUNativeAdsManager setMopubAdMarkUp:successLoadVideo:] at /var/folders/lg/33pj_plj2r563jbng94gj8yc0000hd/T/cocoapods-am1ojdlj/Pods/BUAdSDK/BUAdSDK/BUAdSDK/BUAdSDK/Placeholder/Native/Public/BUNativeAdsManager.m:234

21 0x0000000104d453b8 in -[ALByteDanceMediationAdapter loadNativeAdForParameters:andNotify:] at /usr/local/var/jenkins/workspace/Mobile-iOS-Adapter/iOS-SDK-Mediation-Adapters/ByteDance/ByteDanceAdapter/ALByteDanceMediationAdapter.m:339

22 0x0000000104e79fdc in __98-[ALMediationAdapterWrapper loadNextAdForAdUnitIdentifier:adapterParameters:mediatedAd:andNotify:]_block_invoke_4 ()

23 0x0000000104e7a0d4 in __98-[ALMediationAdapterWrapper loadNextAdForAdUnitIdentifier:adapterParameters:mediatedAd:andNotify:]_block_invoke.152 ()

24 0x0000000104e7c26c in __55-[ALMediationAdapterWrapper runOperationWithTag:block:]_block_invoke ()

25 0x0000000104e7c120 in -[ALMediationAdapterWrapper runOperationWithTag:block:] ()

26 0x0000000104e79d44 in -[ALMediationAdapterWrapper loadNextAdForAdUnitIdentifier:adapterParameters:mediatedAd:andNotify:] ()

27 0x0000000104d94af0 in -[ALMediationService loadThirdPartyMediatedAdForAdUnitIdentifier:mediatedAd:andNotify:] ()

28 0x0000000104dd6b90 in -[ALTaskProcessNextWaterfallAd run] ()

29 0x0000000104e0d77c in -[ALTaskManager executeImmediately:] ()

30 0x0000000104dd572c in -[ALTaskProcessMediationWaterfall run] ()

31 0x0000000104e0d77c in -[ALTaskManager executeImmediately:] ()

32 0x0000000104d63180 in -[ALTaskFetchMediatedAd connectionVia:didSucceedWithCode:responseBody:] ()

33 0x0000000104e55860 in -[ALTaskRepeatRequest connectionVia:didSucceedWithCode:responseBody:] ()

34 0x0000000104e3b830 in -[ALConnectionManager processResponseData:responseCode:responseError:forRequest:emptyResponse:statsTracker:decodeResponse:trackConnectionSpeed:latencyMillis:andNotify:] ()

35 0x0000000104e3aea8 in __143-[ALConnectionManager sendURLSessionRequest:session:withEmptyResponse:statsTracker:decodeResponse:trackConnectionSpeed:taskPriority:andNotify:]_block_invoke ()

36 0x0000000182afb788 in ___lldb_unnamed_symbol540$$CFNetwork ()

37 0x0000000182b0bb7c in ___lldb_unnamed_symbol765$$CFNetwork ()

38 0x0000000183a920c0 in NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK ()

39 0x0000000183aa35c4 in -[NSBlockOperation main] ()

40 0x0000000183a7dcbc in __NSOPERATION_IS_INVOKING_MAIN__ ()

41 0x0000000183a8ddbc in -[NSOperation start] ()

42 0x0000000183a911b8 in NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION ()

43 0x0000000183a9e8fc in __NSOQSchedule_f ()

44 0x00000001066b104c in _dispatch_block_async_invoke2 ()

45 0x00000001066a1f94 in _dispatch_client_callout ()

46 0x00000001066a4c74 in _dispatch_continuation_pop ()

47 0x00000001066a40e8 in _dispatch_async_redirect_invoke ()

48 0x00000001066b3d90 in _dispatch_root_queue_drain ()

49 0x00000001066b46fc in _dispatch_worker_thread2 ()

50 0x00000001dc93ae48 in _pthread_wqthread ()