Skip to content

[Help Wanted]: Android 16 fails to start the foreground location service automatically #378

@mgravindran

Description

@mgravindran

Required Reading

  • Confirmed

Plugin Version

6.0.0

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

Google Pixel 8

Device operating-systems(s)

Android 16

What do you require assistance about?

Issue with Pixel 8 Android 16 - unable to start foreground service.

‼️ Starting FGS with type location callerApp=ProcessRecord{cbc162e 31055:com.innbuilt.hrms/u0a294} targetSDK=35 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_LOCATION] any of the permissions allOf=false [android.permission.ACCESS_COARSE_LOCATION, android.permission.ACCESS_FINE_LOCATION] and the app must be in the eligible state/exemptions to access the foreground only permission
java.lang.SecurityException: Starting FGS with type location callerApp=ProcessRecord{cbc162e 31055:com.innbuilt.hrms/u0a294} targetSDK=35 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_LOCATION] any of the permissions allOf=false [android.permission.ACCESS_COARSE_LOCATION, android.permission.ACCESS_FINE_LOCATION] and the app must be in the eligible state/exemptions to access the foreground only permission
at android.os.Parcel.createExceptionOrNull(Parcel.java:3373)
at android.os.Parcel.createException(Parcel.java:3357)
at android.os.Parcel.readException(Parcel.java:3340)
at android.os.Parcel.readException(Parcel.java:3282)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7485)
at android.app.Service.startForeground(Service.java:862)
at com.huawei.location.sdm.Sdm$$ExternalSyntheticApiModelOutline5.m(D8$$SyntheticClass:0)
at com.transistorsoft.locationmanager.service.AbstractService.c(Unknown Source:92)
at com.transistorsoft.locationmanager.service.AbstractService.a(Unknown Source:32)
at com.transistorsoft.locationmanager.service.TrackingService.onStartCommand(Unknown Source:1)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5722)
at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2785)
at android.os.Handler.dispatchMessage(Handler.java:132)
at android.os.Looper.dispatchMessage(Looper.java:333)
at android.os.Looper.loopOnce(Looper.java:263)
at android.os.Looper.loop(Looper.java:367)
at android.app.ActivityThread.main(ActivityThread.java:9287)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:566)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActiveServices.validateForegroundServiceType(ActiveServices.java:2960)
at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked(ActiveServices.java:2637)
at com.android.server.am.ActiveServices.setServiceForegroundLocked(ActiveServices.java:1899)
at com.android.server.am.ActivityManagerService.setServiceForeground(ActivityManagerService.java:13903)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3740)

[Optional] Plugin Code and/or Config

[Optional] Relevant log output

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