Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Calling Music.stopControl() on Android before setNowPlaying causes null reference crash #380

Closed
2 of 4 tasks
goleary opened this issue Mar 25, 2021 · 4 comments
Closed
2 of 4 tasks

Comments

@goleary
Copy link
Contributor

goleary commented Mar 25, 2021

Attempt to invoke virtual method 'android.app.Notification com.tanguyantoine.react.MusicControlNotification.prepareNotification(androidx.core.app.NotificationCompat$Builder, boolean)' on a null object reference

Description

  1. Sample code (provide repo url or sample code)

Will try to provide a minimal repro later.

  1. Platform ?

    • iOS
    • Android (api 29)
  1. Device
  • Simulator
  • Real device
@PupoSDC
Copy link

PupoSDC commented Mar 26, 2021

Is it possible you are calling MusicControl.handleAudioInterruptions(true);? This call only works on ios and causes a crash in android.

@goleary
Copy link
Contributor Author

goleary commented Mar 26, 2021

We are not using that method, thanks for the tip though!

@PupoSDC
Copy link

PupoSDC commented Mar 27, 2021

Maybe you can share your setup?

The README says:

Make sure when you call MusicControl.resetNowPlaying() and MusicControl.stopControl() you must have controls enabled otherwise it will create issues

So doing what you describe in the title isn't exactly recommended. But i personally have not had issues with this so far.

@goleary
Copy link
Contributor Author

goleary commented Apr 7, 2021

Interesting, I never noticed that. I'm going to go ahead and close this because I don't have time to dig in further at the moment & because this is called out in the readme.

@goleary goleary closed this as completed Apr 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants