iOS 11 AdMob SDK access UI on the main thread: Is this being addressed?

1,277 views
Skip to first unread message

Ky Hopwood

unread,
Jul 20, 2017, 5:08:26 PM7/20/17
to Google Mobile Ads SDK Developers
When running our application, we can see multiple instances where AdMob is accessing UI on the main thread.
When will you have the fix for this issue? 

=================================================================

Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]

PID: 62600, TID: 20772453, Thread name: (none), Queue name: com.google.admob.sdk-core-controller, QoS: 0

Backtrace:

4   ECAppCoreFramework                  0x00000001185ccdab GADiTunesMetadataForFileAtPath + 7819

5   ECAppCoreFramework                  0x0000000118655872 GADDiskUsageStatisticsWithError + 7598

6   ECAppCoreFramework                  0x00000001185d770c GADCategories_GADSlot_Mediation + 32059

7   ECAppCoreFramework                  0x0000000118593a19 GADErrorWithDomainCodeAndDescription + 19410

8   ECAppCoreFramework                  0x0000000118592a17 GADErrorWithDomainCodeAndDescription + 15312

9   libdispatch.dylib                   0x000000011be5a711 _dispatch_call_block_and_release + 12

10  libdispatch.dylib                   0x000000011be5b7a0 _dispatch_client_callout + 8

11  libdispatch.dylib                   0x000000011be640ad _dispatch_queue_serial_drain + 1173

12  libdispatch.dylib                   0x000000011be64ae3 _dispatch_queue_invoke + 342

13  libdispatch.dylib                   0x000000011be60534 _dispatch_queue_override_invoke + 739

14  libdispatch.dylib                   0x000000011be67d79 _dispatch_root_queue_drain + 785

15  libdispatch.dylib                   0x000000011be67a05 _dispatch_worker_thread4 + 54

16  libsystem_pthread.dylib             0x000000011c2cd5a2 _pthread_wqthread + 1299

17  libsystem_pthread.dylib             0x000000011c2cd07d start_wqthread + 13

=================================================================

Main Thread Checker: UI API called on a background thread: -[UIApplication keyWindow]

PID: 62600, TID: 20772453, Thread name: (none), Queue name: com.google.admob.sdk-core-controller, QoS: 0

Backtrace:

4   ECAppCoreFramework                  0x00000001185cc4a6 GADiTunesMetadataForFileAtPath + 5510

5   ECAppCoreFramework                  0x00000001185ccdc3 GADiTunesMetadataForFileAtPath + 7843

6   ECAppCoreFramework                  0x0000000118655872 GADDiskUsageStatisticsWithError + 7598

7   ECAppCoreFramework                  0x00000001185d770c GADCategories_GADSlot_Mediation + 32059

8   ECAppCoreFramework                  0x0000000118593a19 GADErrorWithDomainCodeAndDescription + 19410

9   ECAppCoreFramework                  0x0000000118592a17 GADErrorWithDomainCodeAndDescription + 15312

10  libdispatch.dylib                   0x000000011be5a711 _dispatch_call_block_and_release + 12

11  libdispatch.dylib                   0x000000011be5b7a0 _dispatch_client_callout + 8

12  libdispatch.dylib                   0x000000011be640ad _dispatch_queue_serial_drain + 1173

13  libdispatch.dylib                   0x000000011be64ae3 _dispatch_queue_invoke + 342

14  libdispatch.dylib                   0x000000011be60534 _dispatch_queue_override_invoke + 739

15  libdispatch.dylib                   0x000000011be67d79 _dispatch_root_queue_drain + 785

16  libdispatch.dylib                   0x000000011be67a05 _dispatch_worker_thread4 + 54

17  libsystem_pthread.dylib             0x000000011c2cd5a2 _pthread_wqthread + 1299

18  libsystem_pthread.dylib             0x000000011c2cd07d start_wqthread + 13

=================================================================

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

PID: 62600, TID: 20772461, Thread name: (none), Queue name: com.google.admob.active-view-monitor, QoS: 0

Backtrace:

4   ECAppCoreFramework                  0x00000001185cc07e GADiTunesMetadataForFileAtPath + 4446

5   ECAppCoreFramework                  0x000000011865029f GADMD5DataForNSData + 3098

6   ECAppCoreFramework                  0x0000000118586999 GADActiveViewDictionaryForBounds + 5819

7   libdispatch.dylib                   0x000000011be5a711 _dispatch_call_block_and_release + 12

8   libdispatch.dylib                   0x000000011be5b7a0 _dispatch_client_callout + 8

9   libdispatch.dylib                   0x000000011be640ad _dispatch_queue_serial_drain + 1173

10  libdispatch.dylib                   0x000000011be64ae3 _dispatch_queue_invoke + 342

11  libdispatch.dylib                   0x000000011be60534 _dispatch_queue_override_invoke + 739

12  libdispatch.dylib                   0x000000011be67d79 _dispatch_root_queue_drain + 785

13  libdispatch.dylib                   0x000000011be67a05 _dispatch_worker_thread4 + 54

14  libsystem_pthread.dylib             0x000000011c2cd5a2 _pthread_wqthread + 1299

15  libsystem_pthread.dylib             0x000000011c2cd07d start_wqthread + 13

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Jul 20, 2017, 11:33:06 PM7/20/17
to Google Mobile Ads SDK Developers
Hi there,

We have had a similar report of this issue before and this has been identified as an iOS bug, and not something that can be fixed in the SDK. You can take a look at this open radar for more information.

Regards,
Joshua Lagonera
Mobile Ads SDK Team 

a

unread,
Jul 21, 2017, 6:44:15 AM7/21/17
to Google Mobile Ads SDK Developers
Hi Joshua,

Can you clarify why this issue which occurs in iOS 11 only (because Main Thread Checker is an Xcode 9 / iOS 11 only feature), is deemed an iOS bug when the linked to Radar in that similar report refers to an Open GL bug in iOS 9? Note 'background thread' and 'App goes to background' are different things...

Ky Hopwood

unread,
Jul 21, 2017, 12:30:28 PM7/21/17
to Google Mobile Ads SDK Developers
Thanks, obviously I meant to say... "Access UI on a Background thread! 

Ky Hopwood

unread,
Jul 21, 2017, 12:36:44 PM7/21/17
to Google Mobile Ads SDK Developers
Joshua

Thanks for the Ope Radar link, since that is another crash we have seen for a while. 

What is not clear however is why that means that Google does not check what thread they are on before calling the flagged methods. Certainly your code make certain you don't call the following methods off of the main thread. 
  • -[UIApplication delegate]
  • -[UIApplication keyWindow]
  • -[UIApplication applicationState]


On Thursday, July 20, 2017 at 8:33:06 PM UTC-7, Joshua Lagonera (Mobile Ads SDK Team) wrote:

a

unread,
Jul 21, 2017, 1:03:37 PM7/21/17
to Google Mobile Ads SDK Developers
Ky, I was referring to Joshua's answer to this question. My point is that the open radar he refers to describes an iOS 9 bug, not this iOS 11 specific background thread related bug. I think the confusion arises from the use of the work 'background' where the bug you describe concerns Google's SDK using a UI thread in a background thread and the radar that Joshua referred to describes an OpenGL bug which is completely unrelated as far as I can see except that the work 'background' is also mentioned in that radar.

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Jul 24, 2017, 1:22:52 AM7/24/17
to Google Mobile Ads SDK Developers
Hi All,

I apologize for any confusion caused. The radar link I previously sent is for a specific OpenGL bug and has been unrelated to the issue you want to report on this thread.

Moving forward, can you provide us a sample application where you can see this particular trace? Additionally, can you check if you can replicate this behavior on our sample projects?

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Ambuj Punn

unread,
Nov 6, 2017, 4:16:59 PM11/6/17
to Google Mobile Ads SDK Developers
Joshua,

I'm seeing this exact problem 4 months later on Xcode 9.1 on iOS 11.1. The Google Ads SDK is trying to change the UI on the background thread. Is there an update on this?

I've attached an image of what the Xcode 9 main thread debugger is stating. 

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Nov 6, 2017, 10:47:20 PM11/6/17
to Google Mobile Ads SDK Developers
Hi Ambuj,

Can you confirm to us what version of the Mobile Ads SDK you are using? We have had reports of this in the past and this should have been resolved on version 7.21.0. Can you also try using the latest version of the SDK and see if you are still able to see these warnings? For reference, the latest version (as of writing) is version 7.25.0.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Nov 16, 2017, 1:08:11 AM11/16/17
to Google Mobile Ads SDK Developers
Hi Ambuj,

Hope you are doing well.

Are you still experiencing this issue even after using the latest version of the SDK? Here are the Release Notes for the iOS SDK for reference.

That said, kindly let us know if you would still need our assistance.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

On Tuesday, November 7, 2017 at 5:16:59 AM UTC+8, Ambuj Punn wrote:

Drasko Vucenovic

unread,
Dec 11, 2017, 7:09:31 PM12/11/17
to Google Mobile Ads SDK Developers
Hi Ambuj,

I'm trying to import the GoogleMobileAds pod in my Xcode project and I'm getting the following crash: 

Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]

PID: 35588, TID: 21283180, Thread name: (none), Queue name: com.google.admob.sdk-core-controller, QoS: 0

Backtrace:

4   Cronometer                          0x0000000100a729d7 GADiTunesMetadataForFileAtPath + 7819

5   Cronometer                          0x0000000100afb49e GADDiskUsageStatisticsWithError + 7598

6   Cronometer                          0x0000000100a7d338 GADCategories_GADSlot_Mediation + 32059

7   Cronometer                          0x0000000100a39645 GADErrorWithDomainCodeAndDescription + 19410

8   Cronometer                          0x0000000100a38643 GADErrorWithDomainCodeAndDescription + 15312

9   libclang_rt.tsan_iossim_dynamic.dylib 0x00000001012f942c _ZN6__tsanL24invoke_and_release_blockEPv + 12

10  libclang_rt.tsan_iossim_dynamic.dylib 0x00000001012f9572 _ZN6__tsanL22dispatch_callback_wrapEPv + 306

11  libdispatch.dylib                   0x00000001098a233d _dispatch_client_callout + 8

12  libdispatch.dylib                   0x00000001098aa855 _dispatch_queue_serial_drain + 1162

13  libdispatch.dylib                   0x00000001098ab1ea _dispatch_queue_invoke + 336

14  libdispatch.dylib                   0x00000001098a6f7c _dispatch_queue_override_invoke + 733

15  libdispatch.dylib                   0x00000001098ae102 _dispatch_root_queue_drain + 772

16  libdispatch.dylib                   0x00000001098adda0 _dispatch_worker_thread3 + 132

17  libsystem_pthread.dylib             0x0000000109e045a2 _pthread_wqthread + 1299

18  libsystem_pthread.dylib             0x0000000109e0407d start_wqthread + 13


Could you please fix this and release another version? I don't get the error if I import the framework manually.

Best,
Drasko Vucenovic 
iOS Software Engineer
Cronometer Software Inc.

Drasko Vucenovic

unread,
Dec 11, 2017, 7:11:07 PM12/11/17
to Google Mobile Ads SDK Developers
I mean't Joshua Lagonera. My apologies.

Best,
Drasko Vucenovic 
iOS Software Engineer
Cronometer Software Inc.

Vinh Hoang

unread,
Sep 7, 2018, 1:59:23 PM9/7/18
to Google Mobile Ads SDK Developers
Hi Joshua or other Google Ads SDK team,

Its a year later I'm still getting the same warnings as Ky for iOS 11.  
I'm currently using cocopods Google-Mobile-Ads-SDK (7.0.0)

Main Thread Checker: UI API called on a background thread: -[UIView frame]
PID: 6057, TID: 14246968, Thread name: (none), Queue name: com.google.admob.sdk-core-controller-url, QoS: 0
Backtrace:
4   Hawaii                              0x000000010e4dd360 -[GADSlot(GADSDKCoreControllerDelegate) requestParameters] + 1311
5   Hawaii                              0x000000010e4b3605 __60-[GADSDKCoreController asynchronouslyRequestURLForDelegate:]_block_invoke + 122
6   libdispatch.dylib                   0x00000001199df7ab _dispatch_call_block_and_release + 12
7   libdispatch.dylib                   0x00000001199e07ec _dispatch_client_callout + 8
8   libdispatch.dylib                   0x00000001199e8be5 _dispatch_queue_serial_drain + 1305
9   libdispatch.dylib                   0x00000001199e94fa _dispatch_queue_invoke + 328
10  libdispatch.dylib                   0x00000001199e5344 _dispatch_queue_override_invoke + 726
11  libdispatch.dylib                   0x00000001199ec36c _dispatch_root_queue_drain + 664
12  libdispatch.dylib                   0x00000001199ec076 _dispatch_worker_thread3 + 132
13  libsystem_pthread.dylib             0x0000000119f0b169 _pthread_wqthread + 1387
14  libsystem_pthread.dylib             0x0000000119f0abe9 start_wqthread + 13



Vinh Hoang

unread,
Sep 10, 2018, 9:09:38 PM9/10/18
to google-adm...@googlegroups.com
I've updated to 7.32.0 and the issues has gone away. fyi

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/2b1ad83f-2bc4-467e-b5ef-86d2d386852c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mobileadssdk-a...@google.com

unread,
Sep 11, 2018, 12:10:40 AM9/11/18
to Vinh Hoang, google-adm...@googlegroups.com
Hi Vinh,

Thank you for confirming that the issue is no longer reproducible in the 7.32.0 SDK version. Feel free to create a new thread for any technical concerns you may have with the Mobile Ads SDK and we'll be happy to assist you.

Regards,
Ivan Bautista
Mobile Ads SDK Team



To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages