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

Background geolocation has not worked since Android version 13 #924

Open
DiFo89 opened this issue Jan 23, 2024 · 6 comments · May be fixed by #970
Open

Background geolocation has not worked since Android version 13 #924

DiFo89 opened this issue Jan 23, 2024 · 6 comments · May be fixed by #970

Comments

@DiFo89
Copy link

DiFo89 commented Jan 23, 2024

On versions 13 and 14, there is no notification about background geolocation. Everything works well on previous versions.

I also tested it after "flutter clean" and "flutter upgrade".

The following plugins are used in the project:
cupertino_icons: ^1.0.2
go_router: ^12.0.0
shared_preferences: ^2.0.15
google_fonts: ^4.0.4
flutter_svg: ^2.0.7
accordion: ^2.6.0
signature: ^5.1.0
provider: ^6.0.5
http: ^1.1.0
intl: ^0.18.1
mime: ^1.0.4
http_parser: ^4.0.2
path_provider: ^2.1.1
mask_text_input_formatter: ^2.5.0
location: ^5.0.3

The project has the following permissions:

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>

kotlin_version: 1.9.21

dependencies:
classpath 'com.android.tools.build:gradle:7.3.0'

flutter doctor:
[√] Flutter (Channel stable, 3.13.6, on Microsoft Windows [Version 10.0.22621.3007], locale ru-RU)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.5)
[√] Android Studio (version 2022.2)
[√] VS Code (version unknown)
X Unable to determine VS Code version.
[√] Connected device (5 available)
[√] Network resources

It does not produce any errors during testing.

@crazyvonni
Copy link

crazyvonni commented Feb 27, 2024

For Android 13 I had to extend my permissions to get it run again. I use this:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>

I had the error below, which is now solved. Maybe it is the same cause?

Starting FGS with type location callerApp=ProcessRecord{XXX} 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

@VivekMakwana24
Copy link

@crazyvonni
@DiFo89
Any Solution on this?

@crazyvonni
Copy link

Have you tried to extend the permissions?

For me everything is fine now.

@DiFo89
Copy link
Author

DiFo89 commented Mar 28, 2024

Have you tried to extend the permissions?

For me everything is fine now.

No, I switched to another library because of the short deadlines.

@DiFo89
Copy link
Author

DiFo89 commented Mar 28, 2024

@crazyvonni @DiFo89 Any Solution on this?

I've redone the logic using a different library (background_location)

@lluisclava
Copy link

I have the following error with API level 34:
Starting FGS with type location callerApp=ProcessRecord{58112eb 7114:cat.sol_it.letitbeat/u0a356} 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

I solved it adding added permissos as @crazyvonni said.

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

Successfully merging a pull request may close this issue.

4 participants