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

java.lang.SecurityException - Starting FGS with type location #27

Open
hatched-mariusz opened this issue Aug 15, 2024 · 3 comments
Open

Comments

@hatched-mariusz
Copy link

New issue on the SDK 2.12.1 and Android target 34

Question:
Why U run that foreground service without detecting that You don't have permissions?
Maybe the SDK should not crash the app?

 Fatal Exception: java.lang.SecurityException: Starting FGS with type location callerApp=ProcessRecord{46f3098 11422:com.xxxxx.apps.xxxxx/u0a375} targetSDK=34 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:3069)
       at android.os.Parcel.createException(Parcel.java:3053)
       at android.os.Parcel.readException(Parcel.java:3036)
       at android.os.Parcel.readException(Parcel.java:2978)
       at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7234)
       at android.app.Service.startForeground(Service.java:862)
       at com.radiusnetworks.flybuy.sdk.pickup.service.o.invokeSuspend(SourceFile:9)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
       at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.java:111)
       at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:584)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
@hatched-mariusz
Copy link
Author

the same issue is version 2.12.2 android target SDK 34

@hatched-mariusz
Copy link
Author

the same issue is in version 2.13.0 android target SDK 34.
I think U don't check if that permission was allowed but still, You run the function.
Maybe some try catch or some condition that this permission for sure was allowed by user

@botnerd
Copy link
Member

botnerd commented Sep 26, 2024

We'll look into options for catching this exception

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

2 participants