Topic: Unsupported Android permission and how to remove them

Hello,

While building for Oculus Quest (Unity 2020 LTS) Im getting this error:

ERROR: Validation identified the following errors:

The upload could not be completed because your application contains the following Android permissions that are not supported:
- android.permission.ACCESS_FINE_LOCATION
- android.permission.ACCESS_BACKGROUND_LOCATION
- android.permission.ACCESS_COARSE_LOCATION
Please remove the following permissions and upload your application binary again.

The thing is I don't need those features, I'm only using the OnlineMap to show some location (Markers) on a world map.
I can't seem to find how to remove those permissions without passing the project through AndroidStudio and complicating my build workflow. Is there a simple solution?

Re: Unsupported Android permission and how to remove them

Hello.

Create your own AndroidManifest.xml and put it in Plugins / Android folder.
https://docs.unity3d.com/Manual/android-manifest.html

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Unsupported Android permission and how to remove them

Hi,

I already did, but it seems like some plugin in the OnlineMaps add those 3 permission even if there are not present in my custom manifest in Plugins/Android.

Furthermore, I found yesterday that this problem does not only occur on Android but IOS too (Long story short i'm building my app for quest (the VR version) and android + ios (The mobile version)).

I could use AndroidStudio like I stated before to fix the permissions asked, but it would not fix it for IOS.

Do you have any idea if there is a place in the source code where all the persmissions are requested?

I already tried to set : requestPermissionRuntime = false; in the OnlineMapsLocationService.cs but the permissions still get added to the build (IOS and Android).

Re: Unsupported Android permission and how to remove them

Bingo!

I did fix the problem, reading the unity wiki I read that any call made to the Location APIs triggered ACCESS_FINE_LOCATION, ACCESS_BACKGROUND_LOCATION and ACCESS_COARSE_LOCATION to be added to the combined android manifest.

So I deleted all LocationService classes from OnlineMaps (OnlineMapsLocationServices and all base/generic basse/ editor).

The map works well for our needs now and does not block the build process anymore.