Sithira / FlutterRadioPlayer

Flutter Radio Player, A Plugin to handle streaming audio without a hassle
BSD 3-Clause "New" or "Revised" License
135 stars 61 forks source link

android.app.MissingForegroundServiceTypeException #95

Closed michelmelo closed 1 week ago

michelmelo commented 1 month ago
Exception android.app.MissingForegroundServiceTypeException:
  at android.app.MissingForegroundServiceTypeException$1.createFromParcel (MissingForegroundServiceTypeException.java:53)
  at android.app.MissingForegroundServiceTypeException$1.createFromParcel (MissingForegroundServiceTypeException.java:49)
  at android.os.Parcel.readParcelableInternal (Parcel.java:4870)
  at android.os.Parcel.readParcelable (Parcel.java:4852)
  at android.os.Parcel.createExceptionOrNull (Parcel.java:3052)
  at android.os.Parcel.createException (Parcel.java:3041)
  at android.os.Parcel.readException (Parcel.java:3024)
  at android.os.Parcel.readException (Parcel.java:2966)
  at android.app.IActivityManager$Stub$Proxy.setServiceForeground (IActivityManager.java:7280)
  at android.app.Service.startForeground (Service.java:775)
  at kc.c.a
  at o3.e.F
  at o3.e.o
  at o3.e.a
  at o3.d.handleMessage
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loopOnce (Looper.java:224)
  at android.os.Looper.loop (Looper.java:318)
  at android.app.ActivityThread.main (ActivityThread.java:8770)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:561)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1013)
chaoticcoder1507 commented 1 month ago

Can u provide code??

marcobraghim commented 1 month ago

I'm having this same issue, but only when I try to run the project to Android 14. It seems that there's some kind of permission missing.

https://medium.com/@domen.lanisnik/guide-to-foreground-services-on-android-9d0127dc8f9a

titivermeesch commented 1 week ago

Having the same issue. The changes proposed by Justin should indeed fix this. It's a new requirement in Android API v34