capacitor-community / capacitor-community/background-geolocation

Failed to foreground service...

Open
#153 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
249
Forks
79
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Example app
On the first call of addWatch and request geolocation permissions

**To Reproduce**
Steps to reproduce the behavior:
1. Go to Example app on Android 14,15, 16 in debug mode
2. Click on +BG.
4. Look at Logcat
Failed to foreground service
java.lang.SecurityException: Starting FGS with type location callerApp=ProcessRecord{.....
and app donot move into background

After granting permissions, I restarted the app (removing it from the running processes), and everything worked fine. So, the error only occurred the first time it requested geolocation permissions.

**Expected behavior**
no errors

**Screenshots**

Image

**Smartphone (please complete the following information):**
- Device: Redmi
- OS: Android 14, 15

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.