florent37 / Flutter-AssetsAudioPlayer

Play simultaneously music/audio from assets/network/file directly from Flutter, compatible with android / ios / web / macos, displays notifications
https://pub.dartlang.org/packages/assets_audio_player
Apache License 2.0
740 stars 337 forks source link

ForegroundServiceStartNotAllowedException #801

Open Sanam-Gurung opened 10 months ago

Sanam-Gurung commented 10 months ago

Flutter 3.13.1 Assets audio Player : 3.1.0

Platform (Android / iOS / web) + version

Platform : Android

Fatal Exception: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service com.goodvibes/com.github.florent37.assets_audio_player.notification.NotificationService at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54) at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50) at android.os.Parcel.readParcelable(Parcel.java:3334) at android.os.Parcel.createExceptionOrNull(Parcel.java:2421) at android.os.Parcel.createException(Parcel.java:2410) at android.os.Parcel.readException(Parcel.java:2393) at android.os.Parcel.readException(Parcel.java:2335) at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7343) at android.app.Service.startForeground(Service.java:733) at com.github.florent37.assets_audio_player.notification.NotificationService.displayNotification(NotificationService.kt:349) at com.github.florent37.assets_audio_player.notification.NotificationService.access$displayNotification(NotificationService.kt:32) at com.github.florent37.assets_audio_player.notification.NotificationService$displayNotification$1.invokeSuspend(NotificationService.kt:148) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:210) at android.os.Looper.loop(Looper.java:299) at android.app.ActivityThread.main(ActivityThread.java:8309) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)

seceba commented 9 months ago

I am also experiencing this problem and the other issue. Has the new 3.1.1 update fixed the problem in the new 3.1.1 update and the other issue?

Other issue: https://github.com/florent37/Flutter-AssetsAudioPlayer/issues/803

vbuberen commented 9 months ago

This one is resolved by release 3.1.1, even though 3.1.1 has another bug mentioned above.

imyourdeveloperhere commented 8 months ago

Is this issue resolved? I'm using the version "assets_audio_player: ^3.1.1"

In my android application this issue is occurring, leading to crashes in massive amount of Android 12 & 13 devices.