Flutter-AssetsAudioPlayer icon indicating copy to clipboard operation
Flutter-AssetsAudioPlayer copied to clipboard

CustomMediaButtonReceiver.onReceive

Open Sanam-Gurung opened this issue 11 months ago • 10 comments

Flutter Version Flutter version : 3.13.1

Lib Version

Assets Audio Player version : 3.1.0

Platform (Android / iOS / web) + version

Platform : Android

Describe the bug

CustomMediaButtonReceiver.onReceive

Fatal Exception: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{b4ae231 u0 com.goodvibes/com.github.florent37.assets_audio_player.notification.NotificationService}

Stack trace:

Fatal Exception: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{b4ae231 u0 com.goodvibes/com.github.florent37.assets_audio_player.notification.NotificationService} at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2245) at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2216) at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2508) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8757) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Sanam-Gurung avatar Sep 05 '23 04:09 Sanam-Gurung

Hi, I'm getting the same problem 3.1.1 update is related to this error?

seceba avatar Sep 09 '23 19:09 seceba

Hi, I'm getting the same problem 3.1.1 update is related to this error? yes this problem didnot used to arise in the older version. @seceba

Sanam-Gurung avatar Sep 11 '23 05:09 Sanam-Gurung

Version 3.0.6 does not have this problem. When I updated to version 3.1.0, I started to get this problem.

seceba avatar Sep 11 '23 11:09 seceba

Also seeing this 'ForegroundServiceDidNotStartInTimeException' issue:

  • assets_audio_player: ^3.1.1
  • Flutter version 3.13.6
  • Dart version 3.1.3
  • Android 13 only (so far)
  • app is in the background (not the app's normal mode - it's a foreground-only app, so this may be the logic hole)

richtea99 avatar Oct 13 '23 12:10 richtea99

any updates?

offline-first avatar Dec 02 '23 09:12 offline-first

My update is 'sideways' - try the 'just_audio' package instead.

That's not to say this is a bad package, but 'just_audio' worked for our particular simple requirements, with minimal code changes.

richtea99 avatar Dec 02 '23 09:12 richtea99

So I had to use another package. audioplayers this package sees it.

seceba avatar Dec 02 '23 13:12 seceba

I did a PR which was already merged into master and even though it is focused on changes for Android 14 it might have fixed this issue as well. Thus, I would ask some of those who experience the reported issue to try the version of this plugin from master pointing to my commit:

assets_audio_player:
    git:
      url: https://github.com/florent37/Flutter-AssetsAudioPlayer.git
      ref: 91638830570e5e3c2212d04fd99b8d3b60380dd3

vbuberen avatar Feb 14 '24 12:02 vbuberen

@vbuberen Can you please share version so update version accordingly

mjjoshi avatar Apr 22 '24 05:04 mjjoshi

Any updates?

NebiSarigul avatar Jun 10 '24 16:06 NebiSarigul