Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ForegroundServiceDidNotStartInTimeException stopping the service #316

Open
santiimageen opened this issue Jan 25, 2025 · 0 comments
Open

Comments

@santiimageen
Copy link

santiimageen commented Jan 25, 2025

When I call await FlutterForegroundTask.stopService(); in my code I got below exception.
This happens in Google Pixel 7 Plus (Android 15). However same code in older devices (Xiaomi Mi 10T) works fine without crashing.

01-25 11:48:12.062 20443 20443 E AndroidRuntime: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{16648f5 u0 net.imageen.controller/com.pravera.flutter_foreground_task.service.ForegroundService c:net.imageen.controller}
01-25 11:48:12.062 20443 20443 E AndroidRuntime: 	at com.pravera.flutter_foreground_task.service.ForegroundServiceManager.stop(ForegroundServiceManager.kt:76)
01-25 11:48:12.062 20443 20443 E AndroidRuntime: 	at com.pravera.flutter_foreground_task.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:72)
01-25 11:48:12.062 20443 20443 E AndroidRuntime: 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
01-25 11:48:12.062 20443 20443 E AndroidRuntime: 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
01-25 11:48:12.062 20443 20443 E AndroidRuntime: 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
01-25 11:48:12.062 20443 20443 E AndroidRuntime: 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant