ANR on the Ads media reset

368 views
Skip to first unread message

sam...@saavn.com

unread,
Oct 11, 2021, 3:37:11 AM10/11/21
to Google Mobile Ads SDK Developers
Hi, we are getting this ANR on the regular basis. Any concrete solution for these? This mostly happen because of Mediaplayer reset where it takes time on the main trhead. 

Here are the los :  at android.media.MediaHTTPConnection.disconnect (MediaHTTPConnection.java:172) at android.media.IMediaHTTPConnection$Stub.onTransact (IMediaHTTPConnection.java:132) at android.os.Binder.execTransactInternal (Binder.java:1170) at android.os.Binder.execTransact (Binder.java:1134) at android.media.MediaPlayer._reset (Native method) at android.media.MediaPlayer.reset (MediaPlayer.java:2204) at com.google.android.gms.ads.internal.video.j.y (com.google.android.gms.policy_ads_fdr_dynamite@212910700@212910700057.385466565.385466565:2) at com.google.android.gms.ads.internal.video.j.onSurfaceTextureDestroyed (com.google.android.gms.policy_ads_fdr_dynamite@212910700@212910700057.385466565.385466565:4) at android.view.TextureView.releaseSurfaceTexture (TextureView.java:270) at android.view.TextureView.onDetachedFromWindowInternal (TextureView.java:237) at android.view.View.dispatchDetachedFromWindow (View.java:20682) at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java:3959) at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java:3959) at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java:3959) at android.view.ViewGroup.removeViewInternal (ViewGroup.java:5585) at android.view.ViewGroup.removeViewAt (ViewGroup.java:5532) at androidx.recyclerview.widget.RecyclerView$5.removeViewAt (RecyclerView.java:882) at androidx.recyclerview.widget.ChildHelper.removeViewAt (ChildHelper.java:168) at androidx.recyclerview.widget.RecyclerView$LayoutManager.removeViewAt (RecyclerView.java:8639) at androidx.recyclerview.widget.RecyclerView$LayoutManager.scrapOrRecycleView (RecyclerView.java:9209) at androidx.recyclerview.widget.RecyclerView$LayoutManager.detachAndScrapAttachedViews (RecyclerView.java:9195) at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren (LinearLayoutManager.java:630) at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2 (RecyclerView.java:4134) at androidx.recyclerview.widget.RecyclerView.dispatchLayout (RecyclerView.java:3857) at androidx.recyclerview.widget.RecyclerView.onLayout (RecyclerView.java:4404)

Mobile Ads SDK Forum Advisor

unread,
Oct 11, 2021, 6:00:10 AM10/11/21
to sam...@saavn.com, google-adm...@googlegroups.com

Hello Samrath,

Thank you for reaching out to us.

For us to further investigate this, could you please provide the following details via Reply privately to author option or send it directly to mobileads...@gmail.com? Kindly inform us on this thread if you sent it directly to the email provided.

  • Affected devices
  • Occurrence percentage of the ANR
  • Sample App

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2PIWWp:ref

Samrath Patidar

unread,
Oct 11, 2021, 6:20:23 AM10/11/21
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
Hi, It is mostly happening on Android 11 and 10 devices. Attaching the screenshots of both Android versions as well as devices list. Total occurrence of this issue is around 242 from last 30 days.   
Screen Shot 2021-10-11 at 3.43.12 PM.png
Screen Shot 2021-10-11 at 3.43.29 PM.png
Screen Shot 2021-10-11 at 3.45.23 PM.png

Samrath Patidar

unread,
Oct 11, 2021, 6:22:04 AM10/11/21
to mobileads...@gmail.com, mobile...@forumsupport.google, google-adm...@googlegroups.com, Vivek Sharma
Screen Shot 2021-10-11 at 3.43.12 PM.png
Screen Shot 2021-10-11 at 3.43.29 PM.png
Screen Shot 2021-10-11 at 3.45.23 PM.png

Mobile Ads SDK Forum Advisor

unread,
Oct 11, 2021, 12:04:14 PM10/11/21
to sam...@saavn.com, google-adm...@googlegroups.com
Hi Samrath,

Thank you for bringing this to our attention. I was able to look at the screenshots that you sent us. In looking over them, I see that everything was fine with no issues. Then you have the spike in ANR. From there it looked like it dropped back to nothing. What we would ask is if there was something that was done, ie update or change to something. That could have caused the spike? Also do you have a sample app that would allow us to see the ANR, along with any steps that you know that replicate the issue.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2PIWWp:ref

Samrath Patidar

unread,
Oct 11, 2021, 1:41:47 PM10/11/21
to Mobile Ads SDK Forum Advisor, mobileads...@gmail.com, Vivek Sharma, google-adm...@googlegroups.com
Hi William, 

We have an ad placement inside the recycler view on our main page and it appears to be whenever any video ad is loaded on devices list provided before. This kind of issue was reported from our own code as well where we were using the MediaPlayer reset function. We replaced MediaPlayer with ExoPlayer to fix that but in the case of ads, it is not in the app's control to switch the player. This is not reproducible on the devices we have but captured from the vitals only. Attaching logs of both the ANRs, via ad video and our internal one. It would be great if you can check the logs of both the issues and find any similarity or if there is any way to use ExoPlayer to play these video ads from the library only. Let us know if you need any more help from our side.

Thanks,
Samrath
ANR_Ad_MediaPlayer_Reset.txt
JioSaavn_internal_issue.txt

Mobile Ads SDK Forum Advisor

unread,
Oct 12, 2021, 3:09:24 AM10/12/21
to sam...@saavn.com, vi...@saavn.com, mobileads...@gmail.com, google-adm...@googlegroups.com

Hello Samrath,

Thank you for your response.

In addition to your provided information, can you also provide us a sample app of your implementation and steps to replicate the anr, so that we can further check your implementation that causes the anr? You can send it via Reply privately to author option or send it directly to mobileads...@gmail.com. Kindly inform us on this thread if you sent it directly to the email provided.

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


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