Skip to content

LocationUpdatesService.startTracking -> android.app.ForegroundServiceStartNotAllowedException #66

@autokus

Description

@autokus

First of all, thank you for this plugin, on my experiance it works very well.

But I see such exceptions in the Google Play console. I can't reproduce this and I have no idea how I can fix it.

Exception java.lang.RuntimeException:
at android.app.ActivityThread.handleCreateService (ActivityThread.java:5086)
at android.app.ActivityThread.-$$Nest$mhandleCreateService
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2428)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:226)
at android.os.Looper.loop (Looper.java:313)
at android.app.ActivityThread.main (ActivityThread.java:8762)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)
Caused by android.app.ForegroundServiceStartNotAllowedException:
at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel (ForegroundServiceStartNotAllowedException.java:54)
at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel (ForegroundServiceStartNotAllowedException.java:50)
at android.os.Parcel.readParcelableInternal (Parcel.java:4787)
at android.os.Parcel.readParcelable (Parcel.java:4755)
at android.os.Parcel.createExceptionOrNull (Parcel.java:3018)
at android.os.Parcel.createException (Parcel.java:3007)
at android.os.Parcel.readException (Parcel.java:2990)
at android.os.Parcel.readException (Parcel.java:2932)
at android.app.IActivityManager$Stub$Proxy.startService (IActivityManager.java:6214)
at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1967)
at android.app.ContextImpl.startForegroundService (ContextImpl.java:1933)
at android.content.ContextWrapper.startForegroundService (ContextWrapper.java:839)
at com.icapps.background_location_tracker.service.LocationUpdatesService.startTracking (LocationUpdatesService.java)
at com.icapps.background_location_tracker.service.LocationUpdatesService.onCreate (LocationUpdatesService.java)
at android.app.ActivityThread.handleCreateService (ActivityThread.java:5073)

Devices / OS:
samsung xcoverpro (Android 12 (SDK 31))
samsung r9q (Android 13 (SDK 33))
samsung a42xq (Android 12 (SDK 31))
samsung dm3q (Android 13 (SDK 33))

Lib-Version: 1.4.1

Flutter-Version: 3.13.x (not 100% sure but I think 3.13.5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions