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

CustomMediaButtonReceiver.onReceive #803

Open
Sanam-Gurung opened this issue Sep 5, 2023 · 9 comments
Open

CustomMediaButtonReceiver.onReceive #803

Sanam-Gurung opened this issue Sep 5, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@Sanam-Gurung
Copy link

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 Sanam-Gurung added the bug Something isn't working label Sep 5, 2023
@seceba
Copy link

seceba commented Sep 9, 2023

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

@Sanam-Gurung
Copy link
Author

Sanam-Gurung commented Sep 11, 2023

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

@seceba
Copy link

seceba commented Sep 11, 2023

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

@richtea99
Copy link

richtea99 commented Oct 13, 2023

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)

@offline-first
Copy link
Contributor

any updates?

@richtea99
Copy link

richtea99 commented Dec 2, 2023

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.

@seceba
Copy link

seceba commented Dec 2, 2023

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

@vbuberen
Copy link
Contributor

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

@mjjoshi
Copy link

mjjoshi commented Apr 22, 2024

@vbuberen Can you please share version so update version accordingly

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

7 participants