ANR The main thread is blocked, waiting on a native synchronization routine, such as a mutex.

135 views
Skip to first unread message

曾尚辉

unread,
Jul 25, 2024, 10:17:53 PMJul 25
to Google Mobile Ads SDK Developers
Hey guys,  I need your help here.

I revieve this stack trace in google play console, but I don't know how to solve it.

#00  pc 0x000000000007521c  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
  #01  pc 0x0000000000079988  /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+144)
  #02  pc 0x00000000000db3f0  /apex/com.android.runtime/lib64/bionic/libc.so (pthread_cond_wait+80)
  #03  pc 0x000000000005697c  /system/lib64/libc++.so (std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)+20)
  #04  pc 0x00000000000595bc  /system/lib64/libc++.so (std::__1::__assoc_sub_state::wait()+84)
  #05  pc 0x000000000000aaa4  /system/lib64/libsoundpool.so (android::soundpool::ThreadPool::quit()+252)
  #06  pc 0x000000000000a8ac  /system/lib64/libsoundpool.so (android::soundpool::SoundDecoder::quit()+108)
  #07  pc 0x000000000000c3bc  /system/lib64/libsoundpool.so (android::soundpool::SoundManager::~SoundManager()+68)
  #08  pc 0x0000000000009b48  /system/lib64/libsoundpool.so (android_media_SoundPool_release(_JNIEnv*, _jobject*)+136)
  #09  pc 0x00000000003ae514  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+116)

Mobile Ads SDK Forum Advisor

unread,
Jul 26, 2024, 3:51:40 AMJul 26
to zengsh...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for contacting the Mobile Ads SDK support team.

The stack trace that you have provided doesn’t have anything specific to GMA SDK. Can you confirm whether the same ANR issue is occurring in the Google Sample application too?  Use Optimize initialization and ad loading to improve the overall responsiveness of ads and help prevent "Application Not Responding" (ANR) errors on your app. Also, make all calls to the Mobile Ads SDK on the main thread

If none of the above worked, kindly provide the below details for us to investigate further, check your implementation, find the root cause, and may provide the solution:

  • Full stack trace
  • Device type
  • Steps to reproduce / video recording
  • Sample app with affected app ID and ad unit ID

You can provide the following details via reply privately to the author option or directly provide it to the link below.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002vE9lyQAC&entry.80707362=00259654

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.



ref:!00D1U01174p.!5004Q02vE9ly:ref

Mobile Ads SDK Forum Advisor

unread,
Jul 26, 2024, 7:35:58 AMJul 26
to zengsh...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for getting back to us.

It has come to our attention that we have not received any files. Kindly share them again.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files via reply to author option or by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002vE9lyQAC&entry.80707362=00259654

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

This message is in relation to case "ref:!00D1U01174p.!5004Q02vE9ly:ref" (ADR-00259654)

Thanks,
 
Google Logo Mobile Ads SDK Team


Mobile Ads SDK Forum Advisor

unread,
Jul 26, 2024, 11:09:26 AMJul 26
to zengsh...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for providing the stack trace.

Could you confirm if these ANRs are happening on app launch? If so, I would suggest calling the MobileAds.initialize() method on a background thread within an activity as described in the Get Started guide. So, you don't need to enable the flag. If you call the method on the main thread, enabling the flag will move some of the initialization tasks to the background thread. Kindly refer to initialization.

Upon checking the report I can confirm that the report doesn't contain anything related to Mobile Ads SDK. 

It is hard to validate the ANR issue without having a com.google.android.gms.ads symbol and from the stack trace it is unclear the origin of the issue. Could you try once by updating the SDK and check whether you are experiencing the same issue or not? In case you found anything related to SDK then kindly write to us again. 

Murtessa Tube

unread,
Jul 28, 2024, 3:36:20 PMJul 28
to Mobile Ads SDK Forum Advisor, zengsh...@gmail.com, google-adm...@googlegroups.com

--

---
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/j4RCW000000000000000000000000000000000000000000000SH80GX00F_Bq3q7gReanE_GqV1exiQ%40sfdc.net.

曾尚辉

unread,
Jul 29, 2024, 4:28:36 AMJul 29
to Google Mobile Ads SDK Developers
Hi, 
I had uploaded new trace file, which include com.google.android.gms.ads symbol.

Mobile Ads SDK Forum Advisor

unread,
Jul 29, 2024, 9:32:26 AMJul 29
to zengsh...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for providing the stack trace.

Looking at the stack trace, it appears the ANR is related to WebView init. The WebView init is a heavy task (especially the 1st init call) which unfortunately will occupy the UI thread. The Google Mobile Ads SDK relies on WebView heavily and currently this is not something the team can control. As a result, it is inline with expectations that the ANR is happening to a majority of devices with older Android versions. We would still like to see a minimal reproducible to fully diagnose the issue but at this time we can only recommend lightening the load on the UI thread during app startup, such as delaying tasks until it's necessary to call them. 

Kindly provide the below information privately so we can gain full visibility of your implementation.

  • Sample project reproducing the issue
  • Steps to replicate

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files via reply to author option or by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002vE9lyQAC&entry.80707362=00259654

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

This message is in relation to case "ref:!00D1U01174p.!5004Q02vE9ly:ref" (ADR-00259654)


Thanks,
 
Google Logo Mobile Ads SDK Team


Neon Gaming

unread,
Aug 1, 2024, 11:05:27 AMAug 1
to Google Mobile Ads SDK Developers
google didn't have solution and they are still investigating from months.
[com.google.android.gms:play-services-ads-lite] Causing ANR's

Mobile Ads SDK Forum Advisor

unread,
Aug 1, 2024, 12:34:36 PMAug 1
to gameo...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for contacting the Mobile Ads SDK Support team.

We acknowledged your previous communication and provided a response. However, it appears that the previous response was sent privately.

It is always recommended to keep the SDKs up to date to avoid such issues. As of today, the latest version of Android is 23.2.0 and unity 9.2.0.

Could you confirm whether you have enabled the  Optimize initialization inorder to enhance the overall responsiveness of ads and help prevent “Application Not Responding" (ANR) errors on your app. 

If the issue still persists, kindly provide us the below information privately so that we can gain full visibility of your implementation:

    • Sample project reproducing the issue
    • Steps to replicate
    • unity editor version
    • The full stack trace after updating to the latest versions of the SDK

    Mobile Ads SDK Forum Advisor

    unread,
    Aug 4, 2024, 10:34:37 PMAug 4
    to gameo...@gmail.com, google-adm...@googlegroups.com

    Hi Neon Gaming,

    Thank you for getting back to us.

    Could you kindly furnish us with the information that was requested in our previous communication?

      • Sample project reproducing the issue
      • Steps to replicate (Without any reproducible steps the ANR is not actionable)
      • unity editor version
      • The full stack trace after updating to the latest versions of the SDK
      Reply all
      Reply to author
      Forward
      0 new messages