Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-[UIView gestureRecognizers], -[UIView removeGestureRecognizer:], -[UIView removeFromSuperview] Main Thread Checker: UI API called on a background thread #363

Open
Hachiware-05-01 opened this issue Aug 26, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Hachiware-05-01
Copy link

Hachiware-05-01 commented Aug 26, 2024

MAX SDK Version

12.6.1

Device/Platform Info

iOS 13 ~ 17

Current Behavior

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView gestureRecognizers]
PID: 5272, TID: 39395, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
Backtrace:
4   AppLovinSDK                         0x00000001089a8290 -[UIView(ALUtils) al_removeAllGestureRecognizers] + 48
5   AppLovinSDK                         0x00000001088b410c -[ALNativeAd unregisterViewsForInteraction] + 216
6   AppLovinSDK                         0x00000001088b3a44 -[ALNativeAd destroy] + 20
7   AppLovinSDK                         0x00000001088fcfa4 -[ALAppLovinMediationAdapter destroy] + 80
8   AppLovinSDK                         0x0000000108992970 __36-[ALMediationAdapterWrapper destroy]_block_invoke + 56
9   AppLovinSDK                         0x0000000108993000 __67-[ALMediationAdapterWrapper runOperationWithTag:forAdFormat:block:]_block_invoke + 152
10  AppLovinSDK                         0x00000001088a142c -[ALBlockTask run] + 36
11  AppLovinSDK                         0x000000010895f4c0 -[ALTask main] + 348
12  libdispatch.dylib                   0x00000001095a80f0 _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x00000001095a993c _dispatch_client_callout + 16
14  libdispatch.dylib                   0x00000001095bd6f4 _dispatch_root_queue_drain + 940
15  libdispatch.dylib                   0x00000001095be068 _dispatch_worker_thread2 + 256
16  libsystem_pthread.dylib             0x0000000106e677d8 _pthread_wqthread + 224
17  libsystem_pthread.dylib             0x0000000106e665d4 start_wqthread + 8
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView removeGestureRecognizer:]
PID: 5272, TID: 39395, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
Backtrace:
4   AppLovinSDK                         0x00000001089a82f4 -[UIView(ALUtils) al_removeAllGestureRecognizers] + 148
5   AppLovinSDK                         0x00000001088b410c -[ALNativeAd unregisterViewsForInteraction] + 216
6   AppLovinSDK                         0x00000001088b3a44 -[ALNativeAd destroy] + 20
7   AppLovinSDK                         0x00000001088fcfa4 -[ALAppLovinMediationAdapter destroy] + 80
8   AppLovinSDK                         0x0000000108992970 __36-[ALMediationAdapterWrapper destroy]_block_invoke + 56
9   AppLovinSDK                         0x0000000108993000 __67-[ALMediationAdapterWrapper runOperationWithTag:forAdFormat:block:]_block_invoke + 152
10  AppLovinSDK                         0x00000001088a142c -[ALBlockTask run] + 36
11  AppLovinSDK                         0x000000010895f4c0 -[ALTask main] + 348
12  libdispatch.dylib                   0x00000001095a80f0 _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x00000001095a993c _dispatch_client_callout + 16
14  libdispatch.dylib                   0x00000001095bd6f4 _dispatch_root_queue_drain + 940
15  libdispatch.dylib                   0x00000001095be068 _dispatch_worker_thread2 + 256
16  libsystem_pthread.dylib             0x0000000106e677d8 _pthread_wqthread + 224
17  libsystem_pthread.dylib             0x0000000106e665d4 start_wqthread + 8
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView removeFromSuperview]
PID: 5272, TID: 39395, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
Backtrace:
4   AppLovinSDK                         0x00000001088b4258 -[ALNativeAd unregisterViewsForInteraction] + 548
5   AppLovinSDK                         0x00000001088b3a44 -[ALNativeAd destroy] + 20
6   AppLovinSDK                         0x00000001088fcfa4 -[ALAppLovinMediationAdapter destroy] + 80
7   AppLovinSDK                         0x0000000108992970 __36-[ALMediationAdapterWrapper destroy]_block_invoke + 56
8   AppLovinSDK                         0x0000000108993000 __67-[ALMediationAdapterWrapper runOperationWithTag:forAdFormat:block:]_block_invoke + 152
9   AppLovinSDK                         0x00000001088a142c -[ALBlockTask run] + 36
10  AppLovinSDK                         0x000000010895f4c0 -[ALTask main] + 348
11  libdispatch.dylib                   0x00000001095a80f0 _dispatch_call_block_and_release + 24
12  libdispatch.dylib                   0x00000001095a993c _dispatch_client_callout + 16
13  libdispatch.dylib                   0x00000001095bd6f4 _dispatch_root_queue_drain + 940
14  libdispatch.dylib                   0x00000001095be068 _dispatch_worker_thread2 + 256
15  libsystem_pthread.dylib             0x0000000106e677d8 _pthread_wqthread + 224
16  libsystem_pthread.dylib             0x0000000106e665d4 start_wqthread + 8

Expected Behavior

Main Thread Checker: Resolve UI API errors called in background threads

How to Reproduce

It can be reproduced by releasing the ViewController that implements NativeAd.

Additional Info

No response

@Hachiware-05-01 Hachiware-05-01 added the bug Something isn't working label Aug 26, 2024
@richashukla23 richashukla23 self-assigned this Aug 27, 2024
@richashukla23
Copy link
Contributor

Thanks for your feedback! We will take a look and keep you posted.

@nvrtdfrst
Copy link

nvrtdfrst commented Aug 31, 2024

Having the same problem after upgrading to 12.6.1. Leads to an abrupt crash. It seems to be coming from the method "destroyAd" from my MANativeAdLoader instance. I tried wrapping the call in a block that executes on the main thread but it did not solve the problem. My stacktrace:

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView removeFromSuperview]
PID: 442, TID: 10597, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
Backtrace:
4   Loud Alarm Clock                    0x00000001023de658 -[ALGoogleMediationAdapter destroy] + 512
5   AppLovinSDK                         0x0000000103ca49d4 __36-[ALMediationAdapterWrapper destroy]_block_invoke + 56
6   AppLovinSDK                         0x0000000103ca5064 __67-[ALMediationAdapterWrapper runOperationWithTag:forAdFormat:block:]_block_invoke + 152
7   AppLovinSDK                         0x0000000103bb346c -[ALBlockTask run] + 36
8   AppLovinSDK                         0x0000000103c71524 -[ALTask main] + 348
9   libdispatch.dylib                   0x0000000104e10028 _dispatch_call_block_and_release + 24
10  libdispatch.dylib                   0x0000000104e11860 _dispatch_client_callout + 16
11  libdispatch.dylib                   0x0000000104e23bf0 _dispatch_root_queue_drain + 688
12  libdispatch.dylib                   0x0000000104e24414 _dispatch_worker_thread2 + 208
13  libsystem_pthread.dylib             0x000000020a1e0b14 _pthread_wqthread + 224
14  libsystem_pthread.dylib             0x000000020a1e067c start_wqthread + 8

@Lorenzo45
Copy link
Contributor

@nvrtdfrst thanks for the update. We have a fix for this going out in the next SDK release (internal ticket). We'll let you know when the fix is live.

@Lorenzo45 Lorenzo45 assigned Lorenzo45 and unassigned richashukla23 Sep 9, 2024
@nvrtdfrst
Copy link

@Lorenzo45 Absolutely, thanks for addressing the issue so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants
@nvrtdfrst @Lorenzo45 @richashukla23 @Hachiware-05-01 and others