Music Controller does not show on Android 8 ("developer warning")


#1

My app is streaming music and uses the Music Controller plugin as described here:

https://ionicframework.com/docs/native/music-controls/

The Music Controller icons show correctly in the status bar, and the Music Controller / Player can be opened correctly.

Only on Android 8, the Music Controller icon + player are both missing. Music is however still heard, but there are no means to stop / play the music when the app is pushed to the background.

When running the app on e.g. Android 8 Emulator (API 27), I receive a notification stating: “Developer warning for package ‘xxxx.xxxx.xxxxx’ Failed to post notification on channel ‘null’.”

How can this be fixed for Android 8?


#2

I am looking for an urgent solution to this. This seems to be related to the introduction of notification channels in Android Oreo. Will the Music Controller be updated to support this, or does anyone know of another solution to handle this in JavaScript?


#3

Have you looked at this issue on the cordova plugin page?


#4

Thanks for your message!

I had indeed looked at that before, and had tried the several suggestions, without success.

I gave it another, more thorough go (removed basically everything and tried to find the culprits) and managed to resolve it for Android Oreo by removing the latest plugins and installing (downgrading to) the following versions:

  • Cordova android@6.2.3
    I don’t feel too happy about having to downgrade all the way from 7.0.0 to this version.
    Android 6.4.0 solved the issue as well, but then I had problems PLAYING music!

  • Plugin: cordova-plugin-media@3.0.1

  • Plugin: cordova-plugin-file@4.3.3

The mentioned link falls back to the same version of the plugins, and it seems to be ok now.