-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.IllegalArgumentException: session is already released #422
Comments
Thanks for your report!
All these crashes are on devices with Android 12 and below (at least if The exception is thrown because the session is already released. Which is a bit strange when looking at your service implementation (which, as an aside, looks quite slick with the injection approach :). It doesn't seem that you ever call It's quite odd, that the session that is returned here is then, two lines below when passed to From your code (that looks correct to me), an explanation would be that there is a race between It may be cause by a memory leak of the service, that is fixed since 1.0.2 (see #346). So what I would try: (1) You can check with canary leak whether your current app exhibits the memory leak problem. This still wouldn't explain why there is still a notification when the session is released, but this would be interesting to now. If that's the case upgrading to 1.0.2 is an option. (2) If my above guessing is true, you could try to change I think that this could be a workaround. We could even do this check ourselves in Can you give me an idea on how many users are affected (proportionally to all users)? Sorry for not being able to get a better answer for now, |
Thanks for your help!
I added leakcanary but it did not detect any leaks so far.
I can't do that as it's package private.
Voice 7.0.12 (the one where this was originally reported)
Voice 7.0.14
|
In onGetSession, check if the session is already released in return null in these cases. See androidx/media#422
Okay, entering the badlands now: PaulWoitaschek/Voice@773a406 |
@marcbaechinger |
Just dropping a comment here to maybe add some additional information. We're seeing the same crash logged in Crashlytics using
Please note that the Samsung + Android 14 stats may be a coincidence/market reflection of our user base and their locality. Crashlytics also labels this as "early crash", saying: 92% of crash events for this issue happened in the first 5 seconds of a user's session. We're still investigating repro steps. In the meantime, I was wondering if there were any new insights in what could be causing this issue? I could blindly apply the suggested workaround to see if the issue goes away of course, but I as @marcbaechinger suggested: it'd be good to have a better understanding why this happens. Given that the aforementioned workaround requires reflection, I can't help but wonder if this should maybe be patched in the media framework instead? |
Also happening with Media3 1.4.0 androidx.media3.session.MediaSessionService.addSession
EDIT - more info:
Implementation:
EDIT 2 (solved): To reproduce - only Android 14 and Samsung:
Fix: |
Media3 Version
Media3 1.0.1
Devices that reproduce the issue
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
https://github.com/PaulWoitaschek/Voice/blob/7.0.12/playback/src/main/kotlin/voice/playback/session/PlaybackService.kt
Expected result
It doesn't crash
Actual result
I'm seeing multilpe permutations of this crash.
The biggest one is this, which is strange because that version of Voice does not declare any MEDIA_BUTTON receiver.
Media
not media related
Bug Report
adb bugreport
to dev.exoplayer@gmail.com after filing this issue.The text was updated successfully, but these errors were encountered: