expo: Android app rejected because of background location

Google recently added restrictions to the usage of background location. We’ve been getting multiple reports about this restriction blocking updates within the Google Play Console. Because of that, we want to list a few steps you can take to get your app unblocked.

Configure your project

For managed workflow, make sure you upgraded to SDK 40. In this release, the background location permission was changed to an opt-in permission.

  • Make sure you are using Expo SDK 40.
  • Check if your app manifest has the android.permissions list.
  • Remove the ACCESS_BACKGROUND_LOCATION from this permission list.
  • Build a new APK with expo build:android --type apk --release-channel permission-audit.

For bare workflow, make sure you target Android SDK 29. Google added the background location permission in this version. Before this version, the background location is implied when using both coarse and fine location permissions.

  • Make sure your targetSdkVersion and compileSdkVersion target 29 or higher.
  • Check if your AndroidManifest.xml doesn’t include the ACCESS_BACKGROUND_LOCATION permission.
  • Optionally, you can force-exclude this permission by adding tools:node="remove" (see the permissions docs).
  • Build a new APK with Android Studio or CLI.

Validate the permissions from APK

When you built a new APK, we can validate the included permissions with the AAPT2 tool.

  • Check if you can use AAPT2 (see getting started).
  • Run aapt2 d permissions path/to/app.apk
  • Validate if the ACCESS_BACKGROUND_LOCATION is not listed, if it is remove this permission (see above).

Removing older binaries from Google Play Console

You might have older binaries uploaded in the Google Play Console that uses background location permissions. If you uploaded a new binary, and double-checked that it doesn’t include that permission, remove the older binaries from the Google Play Console. See this Stack Overflow thread for more info.

You can also create a new app in Google Play Console to test if the binary is allowed. If you want to try that, make sure to change the name and the android.package in your app manifest to create a different app.


Still getting blocked?

If your binary is still getting blocked, even after removing older binaries with the ACCESS_BACKGROUND_LOCATION permission, you need to contact Google. You can use this link to get in touch with Google Play Store support.

Edit, as @bryanstearns mentioned, it looks like Google removed the Declare location app permissions option and the ability to directly email Google Play Developer Support. That leaves us with fewer options, here are some that might help:

  1. If your app is getting rejected, use the contact or appeal options in that email instead.
  2. Try using Facebook Messenger to chat with them
  3. Try Tweeting them using @GooglePlayDev
  4. Or try posting on their community forums, don’t mention security sensitive info. But the community isn’t getting answered that fast.
The old way of contacting Google Play Developer Support through email
1. "Let's get started", fill in `App update blocked by background location permission`
2. Click "Next step"
3. "Confirm issue", click `Declare Location App Permissions`
4. Click "Next step"
5. "Contact options", click email (or chat if you need a faster response)
6. Fill in the required info for your account
7. "How can we help?", mention:
    - Your app is blocked from release because of the "background location permission" warning.
    - Your app does not include the `ACCESS_BACKGROUND_LOCATION` permission.
    - Your app is targeting Android SDK 29+.
    - Ask why the update is blocked.
8. Include a screenshot of:
    - Your warning in the Play Store
    - The output of the `AAPT2` command

Please keep in mind that a response from Google is taking longer than expected due to COVID.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 11
  • Comments: 46 (10 by maintainers)

Most upvoted comments

Hi guys this post was really useful. But I found an issue. Note, I’m using:

  • expo managed version
  • SDK 40
  • my android.permissions just ["CAMERA", "READ_EXTERNAL_STORAGE", "WRITE_EXTERNAL_STORAGE"]

If I build my app this way: expo build:android --type apk it doesn’t add any LOCATION permissions here is my aapt2 output:

package: com.something.some
permission: com.something.some.permission.C2D_MESSAGE
uses-permission: name='com.something.some.permission.C2D_MESSAGE'
uses-permission: name='com.google.android.c2dm.permission.RECEIVE'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.SYSTEM_ALERT_WINDOW'
uses-permission: name='android.permission.WAKE_LOCK'
uses-permission: name='android.permission.CAMERA'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission: name='host.exp.exponent.permission.C2D_MESSAGE'
uses-permission: name='android.permission.MODIFY_AUDIO_SETTINGS'
uses-permission: name='android.permission.ACCESS_WIFI_STATE'
uses-permission: name='android.permission.RECEIVE_BOOT_COMPLETED'
uses-permission: name='android.permission.FOREGROUND_SERVICE'
uses-permission: name='com.sonymobile.home.permission.PROVIDER_INSERT_BADGE'
uses-permission: name='com.huawei.android.launcher.permission.CHANGE_BADGE'
uses-permission: name='com.huawei.android.launcher.permission.READ_SETTINGS'
uses-permission: name='com.huawei.android.launcher.permission.WRITE_SETTINGS'
uses-permission: name='android.permission.READ_APP_BADGE'
uses-permission: name='com.oppo.launcher.permission.READ_SETTINGS'
uses-permission: name='com.oppo.launcher.permission.WRITE_SETTINGS'
uses-permission: name='me.everything.badger.permission.BADGE_COUNT_READ'
uses-permission: name='me.everything.badger.permission.BADGE_COUNT_WRITE'
uses-permission: name='com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE'

In the other hand, if I run eas build (both apk or aab) it adds LOCATION permissions which suppose an error on google play app submission.

package: com.plenocentro.admintienda
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.SYSTEM_ALERT_WINDOW'
uses-permission: name='android.permission.READ_PHONE_STATE'
uses-permission: name='android.permission.USE_FINGERPRINT'
uses-permission: name='android.permission.USE_BIOMETRIC'
uses-permission: name='android.permission.VIBRATE'
uses-permission: name='android.permission.MODIFY_AUDIO_SETTINGS'
uses-permission: name='android.permission.ACCESS_COARSE_LOCATION'
uses-permission: name='android.permission.ACCESS_FINE_LOCATION'
uses-permission: name='android.permission.ACCESS_BACKGROUND_LOCATION'
uses-permission: name='android.permission.CAMERA'
uses-permission: name='android.permission.RECORD_AUDIO'
uses-permission: name='android.permission.READ_CONTACTS'
uses-permission: name='android.permission.WRITE_CONTACTS'
uses-permission: name='android.permission.READ_CALENDAR'
uses-permission: name='android.permission.WRITE_CALENDAR'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission: name='android.permission.WRITE_SETTINGS'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.WAKE_LOCK'
uses-permission: name='com.google.android.c2dm.permission.RECEIVE'
uses-permission: name='android.permission.FOREGROUND_SERVICE'
uses-permission: name='com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE'
uses-permission: name='com.google.android.providers.gsf.permission.READ_GSERVICES'
uses-permission: name='com.google.android.gms.permission.ACTIVITY_RECOGNITION'

Would be great if you fix this issue on eas build because it’s an excellent tool and I’m willing to continue paying for it.

Hope this comment help you somehow! I’ll be around if you need more info to tackle this issue.

i had app rejected for ACCES_BACKGROUND_LOCATION use . so to build with expo build:android with expo SDK 45 i had to change my config to :

android: {
  ...config.android,
  package: 'com.*******.app',
  versionCode: 17,
  blockedPermissions: ['ACCESS_BACKGROUND_LOCATION'],
  permissions : [
    "ACCESS_COARSE_LOCATION", 
    "ACCESS_FINE_LOCATION", 
  ],

and then google accepted the new version.

@dhavaljardosh @brentvatne - In my case, app with expo 39 is in the store with the location permission but we are not using it anywhere. Now after google policy update we are trying to update app by removing the location by the expo to 40. but google still rejected it. we also tried it by adding "permissions": []

Those struggling with this issue, here is something that will solve this issue.

By default Expo asks for all permissions, which is ok while testing. But while deploying to Play Store make sure that you add only those you need.

Example of my application:

"permissions": [
        "CAMERA",
        "MEDIA_LIBRARY",
        "CAMERA_ROLL",
        "NOTIFICATIONS",
        "READ_EXTERNAL_STORAGE",
        "WRITE_EXTERNAL_STORAGE"
      ]

I also appreciate this, @byCedric - I’m ~stuck here too~ see update below:

  • I’ve updated my app to SDK 40, verified with aapt2 that my new build doesn’t use ACCESS_BACKGROUND_LOCATION, and my targetSdkVersion and compileSdkVersion are both 29, but it got rejected apparently because the existing production-release version of the app (from last year, SDK 38) is still available. I appealed the rejection but was denied without any additional reasoning.

  • I tried to find a way to somehow deactivate the released version of my app , but couldn’t found a way. I also wasn’t able to use the link you provided to get help from Google Play Support but Declare Location App Permissions isn’t an available choice for me in step 3; I tried many of the choices, but they all lead to it recommending “Community” as the only contact option.

At this point, since there’s still a bit of time before the March deadline, I decided to change my answer in the Policy / App Content / Sensitive app permissions / Manage / Location permissions / Manage to “No, this app does not meet the Location permissions policy”. This should be approved; once it is, I’ll change my answer back to “Yes, this app meets the Location permissions policy” and submit another new version - my hope is that this’ll get approved because there’ll no longer be a non-compliant released version in the way. 🤞

UPDATE: This worked for me - my SDK40 app is now published in the Play store.

Thank you so much for posting this. I have been struggling for the past few weeks to understand why google keeps flagging my app.

@leoafarias - on sdk 42 this will no longer be the case, when you run expo eject or expo prebuild (prebuild is the new name for this command) then it will only include permissions used in your app. you can try sdk 42 beta and we will release it soon. sdk 41 will also not include background location when you prebuild.

i don’t know much about how bitrise does builds but you might want to check out EAS Build as an alternative to expo build, more info here

@devashishsethia & anyone else wondering the same i.e. use of foreground location service to get location updates even when app is not on the foreground or display is off, latest info on supporting this is available in #11854.

Quoting from android docs:

The system considers your app to be using foreground location if a feature of your app accesses the device’s current location in one of the following situations:

An activity that belongs to your app is visible. Your app is running a foreground service. When a foreground service is running, the system raises user awareness by showing a persistent notification. Your app retains access when it’s placed in the background, such as when the user presses the Home button on their device or turns their device’s display off.

Additionally, it’s recommended that you declare a foreground service type of location, as shown in the following code snippet. On Android 10 (API level 29) and higher, you must declare this foreground service type.

I have two questions, if anyone can confirm and help :

  1. Do we need to ask for background location permissions when using startLocationUpdatesAsync because we can start a foreground service with TaskManager?

Additionally, it’s recommended that you declare a foreground service type of location, as shown in the following code snippet. On Android 10 (API level 29) and higher, you must declare this foreground service type.

What should be the name of the service?

I’ve ejected from expo so can update manifest file.

@uen ok - Our app is on bare-workflow. We do have a built-in force update mechanism per platform. Backend define a min version - all apps below this version present on start a “please update our app” dialog with a configurable link. We could link there to the new app.

the “wrong version” exists only in the release track. I create a new app, upload it and click “Check Release”. Than this error appears. It doesnt matter if I upload a new binary in release or internal test track - the error message is always the same.

Bildschirmfoto 2021-03-16 um 07 48 21

“You must remove the geolocation permission requirement from your app if the app is targeted only at children under the age of 13”.

the permission overview in the app as listed in the play console:

Bildschirmfoto 2021-03-16 um 07 56 45

The Button “Start production release” is grey and not clickable. For now i think maybe we can change the target groups to “include all” and leave the “Designed for Families” Program. Then hopefully we can submit, and change it back when the new version is live.

@gp-birender If you can upgrade to Expo 40, great!

@byCedric - @msvargas - Thanks it’s approved now, just remove the old by deploying a new app without location permission with expo 39, But I think it’s better to move to expo 40