Clicking on a banner ad freezes unity android game

301 views
Skip to first unread message

Igor Russov

unread,
Jan 26, 2023, 10:50:43 AM1/26/23
to Google Mobile Ads SDK Developers
Good day everyone. I have encountered an issue with a banner ad in my Unity android game.

When I click on the banner ad the first time, the advertised website opens normaly in my browser. If I return to the game using "recent apps" of android, when I click on the banner the second time, the game freezes. At the moment of second clicking, the banner still contains the same ad it had when I clicked on it the first time.

When reading logs, I found out that clicking on the banner the second times calls the GoogleMobileAdsApi.AppStateEventNotifier.AppStateChanged with AppState.Background. However, the game remains on the screen. Since it probably thinks it is in the background, the game is paused (frozen).

If, in this frozen state, I tap the "home" button on android and open the game from the "recent apps" again, it unfreezes. 

This only happens if I return to the app from the browser which showed the first ad I clicked using the "recent apps" screen. If I return to the game using "back" button, the banner works normaly. 

The following screenshot has the logs from opening the banner ad, returning via "back" button and clicking the banner second time (game works normaly)

photo_2023-01-23_16-46-52.jpg
The following screenshot has logs from clicking banner, returning via "recent apps" screen and clicking the banner second time (the game stays on screen but is frozen)
photo_2023-01-26_17-37-44.jpg

I am using Unity 2020.3.37f and AdMob 7.1.0
The device where this problem is encountered runs Android 12, user interface OneUI 4.1
I was unable to reporoduce the problem on another device running Android 10, MIUI Global 12.0.4

Please tell me which info I should provide to help you understand the problem. I will appreciate any help regarding this issue. 

Mobile Ads SDK Forum Advisor

unread,
Jan 26, 2023, 2:09:38 PM1/26/23
to igorr...@gmail.com, google-adm...@googlegroups.com
Hello,

Could you please check if the issue occurs using our sample app we well? In addition, please provide to us at least a test project where the issue is reproducible via reply privately to author option. 
 

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=5004Q00002iO4Z6QAK&entry.80707362=00164925

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.





Regards,
Google Logo
Teejay Wennie
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2iO4Z6:ref

Igor Russov

unread,
Feb 2, 2023, 6:05:08 AM2/2/23
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
Sorry for the delay, the device where the bug is reproducible was not available. 

I was unable to build a sample project because of some errors, but I created a very simple project with a banner implementation according to your guide. The bug I was talking about is reproducible in the project I submitted with the form. 

We ran some additional tests and discovered that the freeze occurs only if you return to the app by quickly swiping to the side on Samsung devices. I attach a video where the bug is visible https://youtube.com/watch?v=YdudO292v6M&si=EnSIkaIECMiOmarE You can see the bug starting from second 28 (before that normal bunner behaviour is shown). 

чт, 26 янв. 2023 г. в 21:09, Mobile Ads SDK Forum Advisor <mobile...@forumsupport.google>:

Mobile Ads SDK Forum Advisor

unread,
Feb 2, 2023, 3:35:25 PM2/2/23
to igorr...@gmail.com, google-adm...@googlegroups.com

Hi Igor,

 

Thank you for your response and providing additional information.

 

Upon checking the sample project you've provided, I've encounter an error when building it. Can you confirm if you're able to encounter it also in your end? If not, can you provide us steps to replicate to avoid the error? In addition to that, can you confirm if this is only happening using the samsung s10? Kindly provide us also a copy of your APK file where this behavior is reproducible, so we can check it also if the project file is still return an error. You can provide the following details via reply privately to 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=5004Q00002iO4Z6QAK&entry.80707362=00164925

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.

 

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2iO4Z6:ref

shahzad ali

unread,
May 30, 2023, 3:02:09 AM5/30/23
to Google Mobile Ads SDK Developers
Hi all
I am also facing this issue.
Anyone have its solution ?
Mobile Ads SDK Team ?

Mobile Ads SDK Forum Advisor

unread,
Jun 21, 2023, 1:50:49 PM6/21/23
to shahzad.ali...@gmail.com, google-adm...@googlegroups.com
Hi Shahzad,

I have looked into the issue of the application freezing when returning to the app when using the AppStateEvent. I was able to replicate this issue on the Android emulator, however when testing on device I experienced no issue. Can you please try updating to the latest version of the plugin, sample, and confirm this is still an issue on device?

Thanks,
Nick

ref:_00D1U1174p._5004Q2iO4Z6:ref
Reply all
Reply to author
Forward
0 new messages