ANRs happening on PlayerControlView
@marcbaechinger is already working on this.
Since Mar 18, 2025.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.5.1
More version details
Hi team,
We are getting some ANRs related to PlayerControlView. All of these happening while inflating the view.
Can your team please check these. I am posting Some of the major ANRs cause here.
main (runnable)
tid=1 systid=18672
Triggered ANR
Root blocking
androidx.media3.ui.PlayerControlView.<init> (PlayerControlView.java:756)
androidx.media3.ui.PlayerView.<init> (PlayerView.java:572)
androidx.media3.ui.PlayerView.<init> (PlayerView.java:342)
java.lang.reflect.Constructor.newInstance0 (Native method)
java.lang.reflect.Constructor.newInstance (Constructor.java:343)
android.view.LayoutInflater.createView (LayoutInflater.java:883)
android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:1071)
android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:1026)
android.view.LayoutInflater.rInflate (LayoutInflater.java:1188)
android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:1149)
android.view.LayoutInflater.inflate (LayoutInflater.java:708)
android.view.LayoutInflater.inflate (LayoutInflater.java:552)
-
```
main (runnable):tid=1 systid=20970
at androidx.recyclerview.widget.RecyclerView.suppressLayout(RecyclerView.java:2503)
at androidx.recyclerview.widget.RecyclerView.setLayoutFrozen(RecyclerView.java:2559)
at androidx.recyclerview.widget.RecyclerView.setAdapter(RecyclerView.java:1265)
at androidx.media3.ui.PlayerControlView.(PlayerControlView.java:744)
at androidx.media3.ui.PlayerView.(PlayerView.java:572)
at androidx.media3.ui.PlayerView.(PlayerView.java:342)
at java.lang.reflect.Constructor.newInstance0(Native method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:872)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1060)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1015)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1177)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1138)
at android.view.LayoutInflater.inflate(LayoutInflater.java:695)
at android.view.LayoutInflater.inflate(LayoutInflater.java:547)
3.
main (runnable):tid=1 systid=18672
at androidx.media3.common.MediaItem$Builder.(MediaItem.java:99)
at androidx.media3.common.Timeline$Window.(Timeline.java:164)
at androidx.media3.ui.PlayerControlView.(PlayerControlView.java:591)
at androidx.media3.ui.PlayerView.(PlayerView.java:572)
at androidx.media3.ui.PlayerView.(PlayerView.java:342)
at java.lang.reflect.Constructor.newInstance0(Native method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:882)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1034)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:989)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1151)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1112)
at android.view.LayoutInflater.inflate(LayoutInflater.java:700)
at android.view.LayoutInflater.inflate(LayoutInflater.java:544)
4.
main (native):tid=1 systid=28393
#00 pc 0x86f8c libc.so (syscall + 28)
#01 pc 0x1b089c libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 148)
#02 pc 0x6757c8 libart.so (art::GoToRunnable(art::Thread*) + 480)
#03 pc 0x6755a4 libart.so (art::JniMethodEnd(unsigned int, art::Thread*) + 28)
at android.content.res.AssetManager.nativeOpenXmlAsset(Native method)
at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:1104)
at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1341)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2537)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2513)
at android.content.res.Resources.getLayout(Resources.java:1335)
at android.view.LayoutInflater.inflate(LayoutInflater.java:545)
at android.view.LayoutInflater.inflate(LayoutInflater.java:494)
at androidx.media3.ui.PlayerControlView.(PlayerControlView.java:585)
at androidx.media3.ui.PlayerView.(PlayerView.java:572)
at androidx.media3.ui.PlayerView.(PlayerView.java:342)
at java.lang.reflect.Constructor.newInstance0(Native method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:872)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1060)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1015)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1177)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1138)
at android.view.LayoutInflater.inflate(LayoutInflater.java:695)
at android.view.LayoutInflater.inflate(LayoutInflater.java:547)
5.
main (runnable):tid=1 systid=18115
at androidx.media3.ui.PlayerControlViewLayoutManager.(PlayerControlViewLayoutManager.java:126)
at androidx.media3.ui.PlayerControlView.(PlayerControlView.java:725)
at androidx.media3.ui.PlayerView.(PlayerView.java:572)
at androidx.media3.ui.PlayerView.(PlayerView.java:342)
at java.lang.reflect.Constructor.newInstance0(Native method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:877)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1029)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:984)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1146)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1107)
at android.view.LayoutInflater.inflate(LayoutInflater.java:703)
at android.view.LayoutInflater.inflate(LayoutInflater.java:544)
### Devices that reproduce the issue
- 13% Vivo Y22
- 6% Vivo T1
- 13% Galaxy A04e
- 5% Galaxy A04
- 3%Galaxy A04s
- 3% Oppo A57s/A77
95% -> Android OS 14
5% -> Android OS 15
94% -> Background
### Devices that do not reproduce the issue
No idea
### Reproducible in the demo app?
No
### Reproduction steps
Our feature is just playing the video in loop until the user close the screen. All life cycled events are managed.
### Expected result
Media playing successfully. But we are getting ANRs from firebase.
Need to fix the ANRs related to the Media 3 PlayerView
### Actual result
ANRs are happening even after updating the media 3 version 1.5.1
### Media
Nothing
### Bug Report
- [ ] You will email the zip file produced by `adb bugreport` to android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.