Skip to content
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

App Crashing when set media session callbacks. #14

Open
ArielAleksandrus opened this issue Jun 16, 2023 · 6 comments
Open

App Crashing when set media session callbacks. #14

ArielAleksandrus opened this issue Jun 16, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@ArielAleksandrus
Copy link

ArielAleksandrus commented Jun 16, 2023

I'm getting the following error:

androidx.core.app.NotificationCompat$Builder.clearActions()' on a null object reference

Here is the full stack trace:

Caused by java.lang.NullPointerException
Attempt to invoke virtual method 'androidx.core.app.NotificationCompat$Builder androidx.core.app.NotificationCompat$Builder.clearActions()' on a null object reference
io.github.jofr.capacitor.mediasessionplugin.MediaSessionService.update (MediaSessionService.java:223)
io.github.jofr.capacitor.mediasessionplugin.MediaSessionPlugin.updateServicePositionState (MediaSessionPlugin.java:178)
io.github.jofr.capacitor.mediasessionplugin.MediaSessionPlugin.setPositionState (MediaSessionPlugin.java:188)
java.lang.reflect.Method.invoke (Method.java)
com.getcapacitor.PluginHandle.invoke (PluginHandle.java:138)
com.getcapacitor.Bridge.lambda$callPluginMethod$0 (Bridge.java:780)
com.getcapacitor.Bridge.$r8$lambda$ehFTi5f4HhVNFKTbCKAYDkpQYRA
com.getcapacitor.Bridge$$ExternalSyntheticLambda3.run (Unknown Source:8)
android.os.Handler.handleCallback (Handler.java:942)

android.os.HandlerThread.run (HandlerThread.java:67)

I'm using @daubit fork of this project. I believe that in this project, it's not clearActions() method calls. It is mActions.clear().

When I play my audio file, I register the media session callbacks. That's when my app crashes. Any ideas?

@ArielAleksandrus
Copy link
Author

It was actually caused by a bug in https://github.com/DavidBriglio/cordova-plugin-foreground-service

I've found a solution and I've opened an issue. Here are the details:

DavidBriglio/cordova-plugin-foreground-service#25 (comment)

@Amoyens1s
Copy link

I also meet this when I use setPositionState

 Caused by: java.lang.NullPointerException: Attempt to read from field 'java.util.ArrayList androidx.core.app.NotificationCompat$Builder.mActions' on a null object reference in method 'void io.github.jofr.capacitor.mediasessionplugin.MediaSessionService.update()'

@webmasterab
Copy link

webmasterab commented Aug 7, 2023

It also crashed on me.
See image

Screenshot_20230807-012319_Market Feedback Agent

@fromage9747
Copy link

I think y'all are getting this when using it on the Android simulator? Never happens on a physical device. At least in my testing.

@StoneyEagle
Copy link

I had the same issue, I used the example to verify and it worked.
I use webp images in my app and they are not supported
The artwork must be defined as an array, the others may remain undefined.

Thanks for this plugin!

@jofr
Copy link
Owner

jofr commented Jan 21, 2024

Might be related to #19 so should be fixed for now with #18.

@jofr jofr self-assigned this Jan 21, 2024
@jofr jofr added the bug Something isn't working label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants