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.permissionslist. - Remove the
ACCESS_BACKGROUND_LOCATIONfrom 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
targetSdkVersionandcompileSdkVersiontarget29or higher. - Check if your
AndroidManifest.xmldoesn’t include theACCESS_BACKGROUND_LOCATIONpermission. - 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_LOCATIONis 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:
- If your app is getting rejected, use the contact or appeal options in that email instead.
- Try using Facebook Messenger to chat with them
- Try Tweeting them using
@GooglePlayDev - 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)
Hi guys this post was really useful. But I found an issue. Note, I’m using:
android.permissionsjust["CAMERA", "READ_EXTERNAL_STORAGE", "WRITE_EXTERNAL_STORAGE"]If I build my app this way:
expo build:android --type apkit doesn’t add any LOCATION permissions here is myaapt2output: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.Would be great if you fix this issue on
eas buildbecause 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 :
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:
I also appreciate this, @byCedric - I’m ~stuck here too~ see update below:
I’ve updated my app to SDK 40, verified with
aapt2that my new build doesn’t use ACCESS_BACKGROUND_LOCATION, and mytargetSdkVersionandcompileSdkVersionare both29, 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 Permissionsisn’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 ejectorexpo 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:
I have two questions, if anyone can confirm and help :
Do we need to ask for background location permissions when using startLocationUpdatesAsync because we can start a foreground service with TaskManager?
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.
“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:
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