Remove the request for location permissions from your app

upgrading sdk 39 removed 4 more permission which were location related. But still I do have unused permission. Here’s the permission that I request and what expo includes:

      "permissions": [
        "WRITE_EXTERNAL_STORAGE",
        "READ_EXTERNAL_STORAGE",
        "READ_INTERNAL_STORAGE"
      ]

Features(13)

 android.hardware.bluetooth,
 android.hardware.camera,
 android.hardware.camera.autofocus,
 android.hardware.location,
 android.hardware.location.gps,
 android.hardware.location.network,
 android.hardware.microphone,
 android.hardware.screen.landscape,
 android.hardware.screen.portrait,
 android.hardware.telephony,
 android.hardware.touchscreen,
 android.hardware.wifi,
 android.software.leanback

Permissions (24)

 android.permission.ACCESS_NETWORK_STATE,
 android.permission.ACCESS_WIFI_STATE,
 android.permission.FOREGROUND_SERVICE,
 android.permission.INTERNET,
 android.permission.MODIFY_AUDIO_SETTINGS,
 android.permission.READ_APP_BADGE,
 android.permission.READ_EXTERNAL_STORAGE,
 android.permission.READ_INTERNAL_STORAGE,
 android.permission.RECEIVE_BOOT_COMPLETED,
 android.permission.SYSTEM_ALERT_WINDOW,
 android.permission.WAKE_LOCK,
 android.permission.WRITE_EXTERNAL_STORAGE,
 my.app.android.permission.C2D_MESSAGE,
 com.google.android.c2dm.permission.RECEIVE,
 com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE,
 com.huawei.android.launcher.permission.CHANGE_BADGE,
 com.huawei.android.launcher.permission.READ_SETTINGS,
 com.huawei.android.launcher.permission.WRITE_SETTINGS,
 com.oppo.launcher.permission.READ_SETTINGS,
 com.oppo.launcher.permission.WRITE_SETTINGS,
 com.sonymobile.home.permission.PROVIDER_INSERT_BADGE,
 host.exp.exponent.permission.C2D_MESSAGE,
 me.everything.badger.permission.BADGE_COUNT_READ,
 me.everything.badger.permission.BADGE_COUNT_WRITE

Honestly, my app is only a dictionary app, the features I need are writing some data into app’s file system for caching purpose, notification and internet. That’s all, rest is not needed. I was expecting to get rid off with latest SDK (39) but seems nothing has changed but location.

How about the hardware features? I don’t need anything above.

This worked so good!! I was desperate because I’ve tried so many times publishing on PlayStore and always been rejected for LOCATION. Sadly, I had to take off everything about GPS , mapView and location. But, It was necessary while a first version could be published. And what you did suggested works for me.
Well, next steps is researching about using location and be accepted by google play policies.
By the while, I have a tinny smile.
Thanks bro!

Hi @rooftopbase, is it ok if I add the notifications (the only thing I need) within the permissions? Or it needs to be empty at all?

"android": { "permissions": [NOTIFICATIONS], ... }

Apologies for the silly questions but I have never done this How did you remove them manually from package-lock.json?

Hi, could you please share the steps? I was planning to update app.json by adding "android": { "permissions": [NOTIFICATIONS], ... } is this enough? If you manually removed the dependencies from package-lock.json could you please explain me how did you do it, as I am not sure? Thanks in advance

1 Like

Yes, that is what you should do. Also, you should be using at least SDK 38.

Many Thanks @wodin Someone was saying to manually remove the expo-location dependencies from package-lock.json, is this needed as well? Because I am not sure how to do it.

That should not be necessary. Let us know if fixing the permissions in app.json does not work for you on an SDK >= 38 app.

2 Likes

Sure! My SDK is 39 BTW thanks

(My SDK 39 app was rejected for the same issue)

I configured the app.json with an array including only camera and camera roll permissions.

I also deleted my package-lock.json and node modules and used npm install again.

The new build was, however, also rejected.

Expo-locations was in the new package-lock.json, once it was rebuilt.

What would you suggest?

I believe I also upgraded to sdk39 from maybe 36 or 38(whichever was the most recent build 3 months ago), so maybe there’s something in that, I don’t remember the steps exactly that I took.

1 Like

I just tried again, this time removing manually the code from package-lock.json regarding expo-location, and deleting the particular node module. Building threw an error pointing to the module being imported in Expo.fx.expo.js, so I deleted the export and function call there, then made a build.

When I upload to android here is the summary of the bundle:

It looks to me like location is still listed in the features, so I’m doubtful it will pass.


No luck. I also noticed that my app had a yarn.json and yarn-lock.json, so I removed expo-location from both of those and searched the code for “expo-location” which came up empty. However, when i generated a new bundle and uploaded it, the summary has exactly the same features and required permissions.

The only remaining thing I can imagine trying is building a fresh app and copying over the files.

Features should not be a problem. As far as I understand it they just specify the features that the phone must support. So if someone has a phone that has no gps or other location ability, then the Play Store will not allow the app to be installed. It does not mean the app will actually make use of location services.

Yarn and npm do basically the same job. They both install dependencies listed in package.json. Npm keeps track of the package versions etc. in package-lock.json and yarn uses yarn.lock for the same reason.

You should use npm or yarn to manage your dependencies. Not both. If you use npm, make sure you have deleted yarn.lock. If you use yarn, make sure you have deleted package-lock.json.

You should not have to edit package-lock.json or yarn.lock. Also, although it would be better if the app did not mebtion location in the features, I don’t believe it should cause a problem.

So, after you’ve made sure app.json and package.json are right and you only have one lock file, run npm install (if you’re using npm) or yarn (if you’re using yarn). Double check that you still only have one lock file. Then build the app again and that should work.

Alright, another issue could be that because of the first build there were 3 permissions declared, location, fine location are coarse location. I don’t see anywhere in the play store console to remove them.

Screen Shot 2020-11-22 at 4.26.36 PM

@lastof There is no where to turn it off. You will need to rebuild the expo with modified permissions based on recommendations above.

Removed yarn.lock, ran npm isntall again as well, only one lock file, and rebuilt and resubmitted, no luck, the app was still rejected and the declaration of location permissions (that i screenshot in my last post) was not removed.


The initial blocked version was an internal testing release, everything I submitted since then has been a production release, I’m also going to try and release another internal testing release to see if it overwrites the issues they have on file from the first.


Yep! that was it, after I uploaded a build to internal testing, it deactivated the first version which was stopping me from changing my location settings declaration, after that I was able to change it to say that I do not collect location data.

4 Likes

Great! I’m glad you’ve figured out the fix. Thanks for letting us know.

1 Like

I did sdk version 39. I deleted package-lock.json and then did npm install again. Then I got the build and the permissions look like this when I upload it to google. What did I miss?

Features (13)

13 COMMON

android.hardware.bluetooth, android.hardware.camera, android.hardware.camera.autofocus, android.hardware.location, android.hardware.location.gps, android.hardware.location.network, android.hardware.microphone, android.hardware.screen.landscape, android.hardware.screen.portrait, android.hardware.telephony, android.hardware.touchscreen, android.hardware.wifi, android.software.leanback

Screen layouts (4)

4 COMMON

small, normal, large, xlarge

Required permissions (48)

48 COMMON

android.permission.ACCESS_BACKGROUND_LOCATION, android.permission.ACCESS_COARSE_LOCATION, android.permission.ACCESS_FINE_LOCATION, android.permission.ACCESS_NETWORK_STATE, android.permission.ACCESS_WIFI_STATE, android.permission.CAMERA, android.permission.FOREGROUND_SERVICE, android.permission.INTERNET, android.permission.MANAGE_DOCUMENTS, android.permission.MODIFY_AUDIO_SETTINGS, android.permission.READ_APP_BADGE, android.permission.READ_CALENDAR, android.permission.READ_CONTACTS, android.permission.READ_EXTERNAL_STORAGE, android.permission.READ_INTERNAL_STORAGE, android.permission.READ_PHONE_STATE, android.permission.RECEIVE_BOOT_COMPLETED, android.permission.RECORD_AUDIO, android.permission.SYSTEM_ALERT_WINDOW, android.permission.USE_BIOMETRIC, android.permission.USE_FINGERPRINT, android.permission.VIBRATE, android.permission.WAKE_LOCK, android.permission.WRITE_CALENDAR, android.permission.WRITE_EXTERNAL_STORAGE, android.permission.WRITE_SETTINGS, com.anddoes.launcher.permission.UPDATE_COUNT,

//// UPDATE
I made sdk version 39. I have defined an empty permission. I created a new apk and installed it. The problems been solved

1 Like

The following is all that’s needed. Problem solved.

“permissions”: [
“CAMERA”,
“RECORD_AUDIO”,
“READ_CONTACTS”,
“WRITE_CONTACTS”,
“READ_CALENDAR”,
“WRITE_CALENDAR”,
“READ_EXTERNAL_STORAGE”,
“WRITE_EXTERNAL_STORAGE”,
“USE_FINGERPRINT”,
“USE_BIOMETRIC”,
“WRITE_SETTINGS”,
“VIBRATE”,
“READ_PHONE_STATE”,
“com.android.launcher.permission.UPDATE_COUNT”,
“com.android.launcher.permission.INSTALL_SHORTCUT”,
“com.google.android.c2dm.permission.RECEIVE”,
“com.google.android.gms.permission.ACTIVITY_RECOGNITION”,
“com.google.android.providers.gsf.permission.READ_GSERVICES”,
“com.htc.launcher.permission.READ_SETTINGS”,
“com.htc.launcher.permission.UPDATE_SHORTCUT”,
“com.majeur.launcher.permission.UPDATE_BADGE”,
“com.sec.android.provider.badge.permission.READ”,
“com.sec.android.provider.badge.permission.WRITE”,
“com.sonyericsson.home.permission.BROADCAST_BADGE”
],

I’m running the latest version of expo and still getting the same error, google play saying:

`

Permission

android.permission.ACCESS_BACKGROUND_LOCATION

android.permission.ACCESS_FINE_LOCATION

android.permission.ACCESS_COARSE_LOCATION
3 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.