Access location permissions in the manifest

Starting last year, Unity Android builds started to include access_fine_location and access_coarse_location, (and as reported in this issuetracker, even when Low Accuracy Location is checked in Player Settings)

Despite the fix reported in the issuetracker, I still see these in Unity 2017.3. The problem it poses for me is that it filters out almost all Kindle Fire devices on the Amazon Appstore:

And I’m wondering, why are the location permission added to the manifest at all?

1 Like

These location related permissions are added when LocationService is used. If you are not using it in your scripts, one of the plugins in your project probably does. I’d suggest to look for “Input.location” in your scripts. The only way to avoid having those permissions added to the manifest is to not access device location from the scripts. By default when we detect that location service is used, we add the ACCESS_FINE_LOCATION permission to the manifest. If you don’t need a very precise location data, you can select “Low Accuracy Location” in Player Settings which would add ACCESS_COARSE_LOCATION to the manifest instead. (see documentation Unity - Scripting API: LocationService.Start ).

The issue which you’ve linked was a little bit different. It reported that we always add ACCESS_FINE_LOCATION permission to the manifest even when users don’t want to access precise location data. The fix was the added “Low Accuracy Location” checkbox in Player Settings.

1 Like

OK, thanks, I reproduced the intended behavior as you describe in a fresh project, no location access by default, coarse and fine location added if LocationService.Start is added, and only coarse location if Low Accuracy Location is checked.

In my other project, I get both fine_location and coarse_location added whether or not Low Accuracy Location is checked and I don’t see any references to LocationService, so I’ll have to track that down, maybe something is overwriting the manifest.

I did find terminology of Low Accuracy Location in the Player Settings ambiguous, maybe Use Only Low Accuracy Location would be better? (longer, but not as long as some other labels in Player Settings)

Or maybe a Low/High Accuracy combo box with a * note that it’s only added if location service is detected.

Alright, the problem disappeared after I removed an old UnityChannel folder in Plugins.