问题
Currently, I am working on a Courier service app using Flutter. My app need Location permission in foreground to find nearby Courier services. I didn't use any background location permission in my app.
But, when I try to upload my updated app (Previous version of my app is already in Play Store), it shows I took background location permission. Here is a screenshot of play console app summary of updated version of my app:
And here is another screenshot of my previous version of app which is currently on play store:
This is the rejection message from google:
I also set location permission setting on play console of my app when I uploaded my first version of app. Here is a Screenshot of this:
and last this is the pub packages list if it is necessary for this question:
回答1:
If you have installed Android Studio, you may try open a new window with path flutter_project_root/android. After loaded everything, you may open the manifest and click the merged manifest to confirm if there is any package or library using the extra Access Background Location permission.
回答2:
Try adding the following to your AndroidManifest.xml (android/app/src/main/AndroidManifest.xml):
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" tools:node="remove"/>
This will make sure the ACCESS_BACKGROUND_LOCATION permission will be removed even when other plugins add it to the AndroidManifest.xml file. Note that this could trigger unexpected behaviour for those plugins that do rely on this permission.
If you haven't used any "tools" in you AndroidManifest right now, than you need to add
xmlns:tools="http://schemas.android.com/tools"
inside the manifest tag like that:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.[...].app">
Source: https://github.com/Baseflow/flutter-geolocator/issues/535#issuecomment-755996924 https://github.com/Baseflow/flutter-geolocator/issues/535#issuecomment-758410906
After that, your APK/appbundle will definitely not have android.permission.ACCESS_BACKGROUND_LOCATION anymore, no matter which package, whether Flutter or Native, wants to set you this permission.
Google Play Console keeps rejecting your updates? Then here is another possibility that may be the cause. To find out the following has cost me weeks of frustration:
If it is still denied, then please check in the Google Play Console if the android.permission.ACCESS_BACKGROUND_LOCATION exists under App Content (last menu item in the left menu) and there in the Sensitive App Permissions. If so, then you can also find out here at "manage" from which app version Google has this information. If an older version is the trigger here, please check if this version still exists in a Release Channel (maybe Internal Test or Closed Test). If yes, then replace the version here with your current one, where you checked, that it no longer has this permission. Please also if the related release channel is paused! Any app version that is active in one of the release channels must be without the background permissions, even the paused channels. Now, in the Sensitive App Permissions at App Content in the Play Store, the question that you do not access the background permissions can be filled in again.
I'm sorry if I don't have the exact English wording of the menu items in the Play Store Console, as my Play Store is set to German.
来源:https://stackoverflow.com/questions/65536318/app-update-is-rejected-from-google-play-due-to-background-location-access-but-i