flutter_background_geolocation
flutter_background_geolocation copied to clipboard
Android Bad notification for startForeground crash
Your Environment
- Plugin version: 4.9.0
- Platform: Android
- OS version: 13
- Device manufacturer / model: Galaxy S20
- Flutter info (
flutter doctor
): - Plugin config:
E/AndroidRuntime(27756): android.app.RemoteServiceException$CannotPostForegroundServiceNotificationException: Bad notification for startForeground
E/AndroidRuntime(27756): at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2222)
E/AndroidRuntime(27756): at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
E/AndroidRuntime(27756): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2508)
E/AndroidRuntime(27756): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(27756): at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime(27756): at android.os.Looper.loop(Looper.java:313)
E/AndroidRuntime(27756): at android.app.ActivityThread.main(ActivityThread.java:8757)
E/AndroidRuntime(27756): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(27756): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/AndroidRuntime(27756): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
E/TSLocationManager(27756): [c.t.l.a.BackgroundGeolocation$w0 uncaughtException]
E/TSLocationManager(27756): ‼️ Uncaught Exception: Bad notification for startForeground
I don't know how to reproduce this, but it rarely crashed by Bad notification for startForeground
.
When can this situation happen?
Your app is likely missing an expected app icon file.
@christocracy I've been using small icon like below and it works.
bg.Notification(
channelId: 'my_channel_id',
title: myTitle,
text: myContent,
smallIcon: 'drawable/img_noti_small'
)
Is largeIcon required too?
Is largeIcon required too?
No.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.