You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Getting ResourceBusyException while playing video on android 14 devices only. #1145
fatal Exception: java.lang.NoSuchMethodError: no non-static method "Landroid/media/ResourceBusyException;.<init>(Ljava/lang/String;III)V"
at android.media.MediaDrm.provideKeyResponse(MediaDrm.java)
at androidx.media3.exoplayer.drm.FrameworkMediaDrm.provideKeyResponse(FrameworkMediaDrm.java:266)
at androidx.media3.exoplayer.drm.DefaultDrmSession.onKeyResponse(DefaultDrmSession.java:520)
at androidx.media3.exoplayer.drm.DefaultDrmSession.access$100(DefaultDrmSession.java:61)
at androidx.media3.exoplayer.drm.DefaultDrmSession$ResponseHandler.handleMessage(DefaultDrmSession.java:609)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.os.HandlerThread.run(HandlerThread.java:67)
Devices that reproduce the issue
Device running on android 14Android
Devices that do not reproduce the issue
Device running below android 14
Reproducible in the demo app?
No
Reproduction steps
In our app, We are playing DRM-protected video, and a few months ago, we migrated from Exoplayer to Media3. Now we have star getting the error on Firebase crashlytics. We are still not able to reproduce this issue.
fatal Exception: java.lang.NoSuchMethodError: no non-static method "Landroid/media/ResourceBusyException;.<init>(Ljava/lang/String;III)V"
at android.media.MediaDrm.provideKeyResponse(MediaDrm.java)
at androidx.media3.exoplayer.drm.FrameworkMediaDrm.provideKeyResponse(FrameworkMediaDrm.java:266)
at androidx.media3.exoplayer.drm.DefaultDrmSession.onKeyResponse(DefaultDrmSession.java:520)
at androidx.media3.exoplayer.drm.DefaultDrmSession.access$100(DefaultDrmSession.java:61)
at androidx.media3.exoplayer.drm.DefaultDrmSession$ResponseHandler.handleMessage(DefaultDrmSession.java:609)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.os.HandlerThread.run(HandlerThread.java:67)
```Firebase
### Expected result
Video must be played on any android version.The videoAndroid
### Actual result
Keep getting the crash on every android 14 device randomly.
### Media
https://play.google.com/store/apps/details?id=com.prepladder.learningapp
### Bug Report
- [ ] You will email the zip file produced by `adb bugreport` to android-media-github@google.com after filing this issue.
The error is actually NoSuchMethodError while trying to construct a ResourceBusyException inside the DRM framework. This looks like the same issue as [internal b/291440132], except that was for NotProvisionedException instead. This was resolved by http://r.android.com/2770659, which looks like it should have fixed it for ResourceBusyException too. This fix wasn't included in the original Android 14 release, but should be included in QPR2: https://developer.android.com/about/versions/14/release-notes-qpr2
Media3 has some special handling for ResourceBusyException. I will update this to also work for NoSuchMethodError where the message indicates we failed to construct a ResourceBusyException which should help to mitigate the issue:
Activity
icbaker commentedon Mar 4, 2024
The error is actually
NoSuchMethodErrorwhile trying to construct aResourceBusyExceptioninside the DRM framework. This looks like the same issue as [internal b/291440132], except that was forNotProvisionedExceptioninstead. This was resolved by http://r.android.com/2770659, which looks like it should have fixed it forResourceBusyExceptiontoo. This fix wasn't included in the original Android 14 release, but should be included in QPR2: https://developer.android.com/about/versions/14/release-notes-qpr2Media3 has some special handling for
ResourceBusyException. I will update this to also work forNoSuchMethodErrorwhere the message indicates we failed to construct aResourceBusyExceptionwhich should help to mitigate the issue:media/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/drm/DefaultDrmSessionManager.java
Lines 657 to 660 in bcfad4b
SurajBahadur commentedon Mar 4, 2024
@icbaker Helpful, Thank you for the udate.
Add workarounds for `NoSuchMethodError` from DRM framework exceptions
Add workarounds for `NoSuchMethodError` from DRM framework exceptions
Add workarounds for `NoSuchMethodError` from DRM framework exceptions