Open waplay opened 2 years ago
me too
Fatal Exception: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service com.appspot.nkek.babyhan.baby_asmr/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:3345)
at android.os.Parcel.createExceptionOrNull(Parcel.java:2432)
at android.os.Parcel.createException(Parcel.java:2421)
at android.os.Parcel.readException(Parcel.java:2404)
at android.os.Parcel.readException(Parcel.java:2346)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:8091)
at android.app.Service.startForeground(Service.java:733)
at com.github.florent37.assets_audio_player.notification.NotificationService.displayNotification(NotificationService.java:482)
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:81)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:13)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:128)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
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:1135)
Any solution?
Any solution?
Add in your manifest the following permissions:
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
Also add this service in your manifest too:
<service
tools:node="replace"
android:name=".notification.NotificationService"
android:foregroundServiceType="mediaPlayback"
android:enabled="true"
android:exported="true">
</service>
@akarapetsas I added your proposed solution to my app's manifest, but still receive the same error.
Flutter Version: 3.0.0 Lib Version: 3.0.4+3 Platform: Android
Error message in Google Play Console:
How to fix this problem?