Once again, MobileAds.initialize blocks, causing the program to die and a black screen.

591 views
Skip to first unread message

Game keys

unread,
May 30, 2018, 3:38:27 PM5/30/18
to Google Mobile Ads SDK Developers
Once again, MobileAds.initialize blocks, causing the program to die and a black screen,Recently, several users and I have had feedback on my application's black screen problem. I thought that only a very few people even met my own black screen. In the Google background, my application suddenly increased the crash rate by 60,000. %, I am very confused, why call MobileAds.initialize will block the entire application, I really difficult to understand such a design, if it is my access to admob sdk code error caused by, I am very easy to understand. What puzzles me is that at the beginning of admob everything is normal, a few days, two weeks, or even a little longer, you will encounter the start of the application, and then call MobileAds.initialize initialization, this code blocks the entire The application, which caused the application to be unresponsive for a long time, and the black screen then crashed, I knew there was a temporary solution. First, comment out the MobileAds.initialize line, retype the apk package, and then use the crashed phone to install and run the application. Finally cancel the MobileAds.initialize comment, re-apk apk package, and then use the crashed phone to install, run the application, everything is back to normal ---- Is my code wrong? But in the end I didn't change any code. But this is only a temporary solution. What is the application that has been put on the google store? I want to crash, admob can adjust it properly? MobileAds.initialize initializes even if the failure does not block the entire application
WechatIMG60.jpeg
WX20180520-122619.png
WechatIMG61.jpeg

mobileadssdk-a...@google.com

unread,
May 31, 2018, 3:47:25 AM5/31/18
to Game keys, Google Mobile Ads SDK Developers
Hi,

Thank you for getting back to us and for masking your Ad Unit Id in the provided screenshot.

Initializing the Mobile Ads SDK using the MobileAds.initialize should only be done once and ideally, at app launch. It is expected that a call to this method will be resource intensive since it is initializing the entire Mobile Ads SDK, but it definitiely shouldn't get to the point that it will be blocking your app. 

That said, the ANR count is indeed alarming. With this, I retested our sample app and put logs before and after the MobileAds.initialize line for debugging purposes, however, the logs appeared successfully on my end and we didn't encounter the blocking behavior you described.

For us to further investigate on this, it would be really helpful if you could share with us privately (using Reply privately to author option) a copy of your project where issue is reproducible.

Regards,
Ivan Bautista
Mobile Ads SDK Team

Bao Le Duc

unread,
Nov 29, 2018, 4:26:17 AM11/29/18
to Google Mobile Ads SDK Developers
Hi,

We also have this issue in our app. It never happens on our test environment but it's the top ANR on Play store. 

Can MobileAds.initialize() be initialised in a background thread?

Best,
Bao

mobileadssdk-a...@google.com

unread,
Nov 29, 2018, 10:29:51 PM11/29/18
to Bao Le Duc, Google Mobile Ads SDK Developers
Hi Bao,

Thank you for reaching out to us. 

Could you provide to us the ANR reports and/or related captured stack traces for this so we can have a closer look? 

Also, could you confirm what SDK version are you using? If you are using an older SDK version, if possible, for testing purposes, could you monitor if the ANR reports decrease if you use the latest SDK version (17.1.1 as of this writing)? Please note that starting 17.0.0, you also have to add your AdMob App ID to your app's AndroidManifest.xml file to properly initialize the SDK.

However, since this is an old thread, could you create a new thread and share with us your new findings?

Regards,
Ivan Bautista
Mobile Ads SDK Team


--

---
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-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/19f2aed1-aeec-4da0-9f5a-402f6e4b086e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages