SDK40 - Android - [Unhandled promise rejection: Error: Not authorized to use background location services.]

Hello,

I am having issues getting authorized to run background location tasks in Android. I have requested permission from Google Play Store for my app and have been approved for ACCESS_BACKGROUND_LOCATION, I have added this to my app.json as well for Android permissions.

On iOS everything works as it should but on Android it does not. When I try to run something as simple as:

await Location.hasStartedGeofencingAsync

I get the error in the title of this post. What more do I have to do to be able to test these features? Is something missing from the expo client itself? Has anyone been able to get this to work since the new update?

Thank you

Hello,

I am having this same issue while running:

await Location.startLocationUpdatesAsync

Could someone at Expo address this issue? Thanks.

Me too…

So I just roll back to SDK39 (I did “git clean --force && git reset --hard” as instructed and expo install )

1 Like

Having the same issue as well, await Location.startLocationUpdatesAsync() was working only intermittently on v39 on Android for me anyways.

I wonder if this has more to do with the stricter background location permissions Apple & Google rolled out semi-recently.

Please post the android section of your app.json.

"android" : {
      "permissions": [
      "CAMERA",
      "ACCESS_FINE_LOCATION",
      "ACCESS_BACKGROUND_LOCATION"
    ],
      "config": {
        "googleMaps": {
          "apiKey": "..."
        }
      }
    }

It’s important to note that I only get this error/warning on a physical device and the option to give expo location permissions has disappeared from the phone’s settings app, even after approving the Permissions.askAsync(Permissions.LOCATION) prompt in the app.

Any good solution?