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
Exception ocurring leading to crash: android.app.ForegroundServiceStartNotAllowedException #813
Comments
I'm getting the same error. Is there any progress?
FATAL EXCEPTION: main |
For my application this method worked. I just added permission to the manifest. "android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" |
Thanks to @omerb09 for pointing on a solution. I have made a PR which was already merged, so would suggest to try and use the plugin but point to that commit in
|
Thanks @vbuberen this version seems to work |
Oh, didn't expect that fast feedback. In such case could you tell me if it works Ok for you on other Android versions? |
I published my application with the version you mentioned for my test users. I didn't catch any errors with this issue. However, they threw out the error in #803. All errors occurred while the application was in the background. It also happened on Android 13 and 14. |
|
@vbuberen Now you are using android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK in the new version of the package. Google Play requires us to explain with a video why we use this permission for Android 14 version. |
My Flutter Version: 3.7.0
Lib Version: 3.1.1
Platform Android
Platform : Android
Describe the bug
Occurring the Android 12 & 13 majorly, issue is the foreground.
com.github.florent37.assets_audio_player.notification.NotificationService.displayNotification
android.app.ForegroundServiceStartNotAllowedException
A clear and concise description of what the bug is.
Exception:
Exception android.app.ForegroundServiceStartNotAllowedException:
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.java)
at com.github.florent37.assets_audio_player.notification.NotificationService.access$displayNotification (NotificationService.java)
at com.github.florent37.assets_audio_player.notification.NotificationService$displayNotification$1.invokeSuspend (NotificationService.java)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (BaseContinuationImpl.java)
at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.java)
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
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1038)
Caused by android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked (ActiveServices.java:1894)
at com.android.server.am.ActiveServices.setServiceForegroundLocked (ActiveServices.java:1403)
at com.android.server.am.ActivityManagerService.setServiceForeground (ActivityManagerService.java:12338)
at android.app.IActivityManager$Stub.onTransact (IActivityManager.java:3318)
at com.android.server.am.ActivityManagerService.onTransact (ActivityManagerService.java:2559)
The text was updated successfully, but these errors were encountered: