flutter_background_service icon indicating copy to clipboard operation
flutter_background_service copied to clipboard

java.lang.IllegalStateException: Not allowed to start service Intent

Open Haris2v opened this issue 2 years ago • 8 comments

We are facing this issue on some android devices, especially Samsung. This issue is appearing 98% in the background mode.

I'm using: flutter_background_service: ^2.1.3

Here is the error: Fatal Exception: java.lang.RuntimeException: Unable to start receiver id.flutter.flutter_background_service.WatchdogReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.example.app/id.flutter.flutter_background_service.BackgroundService }: app is in background uid UidRecord{e2c8c82 u0a238 RCVR bg:+16m16s340ms idle change:uncached procs:1 seq(138,138,138)} at android.app.ActivityThread.handleReceiver(ActivityThread.java:3400) at android.app.ActivityThread.access$1200(ActivityThread.java:205) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1667) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:280) at android.app.ActivityThread.main(ActivityThread.java:6706) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

and my flutter doctor is: [✓] Flutter (Channel stable, 3.3.7, on macOS 11.7 20G817 darwin-x64, locale en-GB) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.71.2)

Haris2v avatar Dec 02 '22 11:12 Haris2v

@Haris2v I also met the same problem. Have you solved it

wzg-githome avatar Dec 03 '22 06:12 wzg-githome

@Haris2v I also met the same problem. Have you solved it

QinGuiCheng avatar Jan 05 '23 07:01 QinGuiCheng

@Haris2v estou com mesmo problema e estou com versão mais atualizada do flutter_background_service.

tiesariatzori avatar Jan 05 '23 12:01 tiesariatzori

@tiesariatzori Hello, has this problem been solved?

QinGuiCheng avatar Jan 07 '23 01:01 QinGuiCheng

Same here. please share some information if you solved the issue. Thanks

wasibdev avatar Feb 27 '23 07:02 wasibdev

same issue here

razfazz avatar May 05 '23 10:05 razfazz

i found out that this issue only appears when using isForegroundMode: false,

razfazz avatar May 05 '23 11:05 razfazz

@razfazz I reject that, it appears on any value of isForegroundMode

1encore avatar Mar 11 '24 10:03 1encore