-
Notifications
You must be signed in to change notification settings - Fork 203
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
App is crashing after updating targetsdkversion to 34 #479
Comments
I have one solution. 1)- Please make sure your project already use the version of gradle tools below:in android/build.gradle classpath 'com.android.tools.build:gradle:7.4.2'
|
it didnt work for me and i did all you asked, I do trying to fetch GPS from Gelocatoer plugin in foreground tho |
any updates to this? same here |
We are experiencing the same issue. We even commented all code in the task to exclude any issues with the code. |
Make sure you declare permissions as specified in https://developer.android.com/develop/background-work/services/fg-service-types. Declaring correct permission fixed this issue in my app. example: if you use |
For anyone havving this issue, follow this steps. Add to Android Manifest.
Example below.
|
E/AndroidRuntime(27349): FATAL EXCEPTION: main
E/AndroidRuntime(27349): Process: com.leads.manager, PID: 27349
E/AndroidRuntime(27349): android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{1c421a4 u0 com.leads.manager/id.flutter.flutter_background_service.BackgroundService}
E/AndroidRuntime(27349): at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2292)
E/AndroidRuntime(27349): at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2263)
E/AndroidRuntime(27349): at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
E/AndroidRuntime(27349): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2561)
E/AndroidRuntime(27349): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(27349): at android.os.Looper.loopOnce(Looper.java:257)
E/AndroidRuntime(27349): at android.os.Looper.loop(Looper.java:368)
E/AndroidRuntime(27349): at android.app.ActivityThread.main(ActivityThread.java:8839)
E/AndroidRuntime(27349): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(27349): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572)
E/AndroidRuntime(27349): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
E/AndroidRuntime(27349): Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here
E/AndroidRuntime(27349): at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1992)
E/AndroidRuntime(27349): at android.app.ContextImpl.startForegroundService(ContextImpl.java:1936)
E/AndroidRuntime(27349): at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:840)
E/AndroidRuntime(27349): at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(ContextCompat.java:1128)
E/AndroidRuntime(27349): at androidx.core.content.ContextCompat.startForegroundService(ContextCompat.java:700)
E/AndroidRuntime(27349): at id.flutter.flutter_background_service.FlutterBackgroundServicePlugin.start(FlutterBackgroundServicePlugin.java:83)
E/AndroidRuntime(27349): at id.flutter.flutter_background_service.FlutterBackgroundServicePlugin.onMethodCall(FlutterBackgroundServicePlugin.java:127)
E/AndroidRuntime(27349): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/AndroidRuntime(27349): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/AndroidRuntime(27349): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/AndroidRuntime(27349): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/AndroidRuntime(27349): at android.os.Handler.handleCallback(Handler.java:958)
E/AndroidRuntime(27349): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(27349): ... 6 more
The text was updated successfully, but these errors were encountered: