flutter_background_service icon indicating copy to clipboard operation
flutter_background_service copied to clipboard

when I used a flutter_background_service plugin in my app. Crashed App when installing an app on a Samsung device.

Open ubitechparth opened this issue 2 years ago • 6 comments

when I used a flutter_background_service plugin in my app. Crashed App when installing an app on a Samsung device. V/BackgroundService( 4930): Starting flutter engine for background service I/AndroidAlarmManagerPlugin( 4930): onAttachedToEngine D/BackgroundServicePlugin( 4930): onAttachedToService D/AndroidRuntime( 4930): Shutting down VM E/AndroidRuntime( 4930): FATAL EXCEPTION: main E/AndroidRuntime( 4930): android.app.RemoteServiceException: Bad notification for startForeground E/AndroidRuntime( 4930): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1774) E/AndroidRuntime( 4930): at android.os.Handler.dispatchMessage(Handler.java:106) E/AndroidRuntime( 4930): at android.os.Looper.loop(Looper.java:164) E/AndroidRuntime( 4930): at android.app.ActivityThread.main(ActivityThread.java:6543) E/AndroidRuntime( 4930): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 4930): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440) E/AndroidRuntime( 4930): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)

ubitechparth avatar Jan 27 '23 06:01 ubitechparth

Did you provide proper configuration for notification? It says something is wrong about notification

donik1998 avatar Jan 31 '23 09:01 donik1998

We configured channel this way and works fine

notificationChannelId: 'my_foreground', initialNotificationTitle: 'any_title_you_want', initialNotificationContent: 'Initializing', foregroundServiceNotificationId: some_int_value,

donik1998 avatar Jan 31 '23 09:01 donik1998

Facing a similar problem, even though I used the example app.

asadamatic avatar Mar 29 '23 03:03 asadamatic

Same crash here,

When I comment "notificationChannelId" params it works but the "stopSelf()" cannot remove the notification foreground.

Test device : Samsung Galaxy Note8 (Android 9)

MapleNoise avatar Apr 14 '23 07:04 MapleNoise

Same crash here,

SM F936U1 (mobile) • RFCTA0BR6DM • android-arm64 • Android 13 (API 33)

philos3 avatar Jul 28 '23 05:07 philos3