Why does my App need android.permission.FOREGROUND_SERVICE_LOCATION?
Asked Answered
M

1

5

I have been working on various features on our Android 14 App using the latest version of Android Studio Hedgehog and Java over the past months. Whenever I completed a big feature, I published the App using Google's Play Console.

Today, I wasn't able to do so, because apparently my App uses android.permission.FOREGROUND_SERVICE_LOCATION and because of that I need to adjust our Manifest file to show where we use this permission and I need to declare via video in Google's Play Console where we use it and why we need it.

My problem: I do not know where we use it...

  • If I search for the text FOREGROUND_SERVICE_LOCATION I do not find anything.
  • If I search for functions that are associated with this permission such as startForeground or stopForeground (see here), I have zero hits.
  • I also checked for the word permission throughout the entire application and found nothing that was unexpected or had foreground in its name.
  • We have no object that extends a Service or a Worker.

I do use quite a lot of hardware components on the devices (camera, location, Bluetooth, NFC, Barcode Scanner, ...), but only when the App is running and not in the background.

But when I upload the latest Bundle into Google's Play Console, I get the following list of permissions the App apparently requests. Many of them I do in fact declare in our Manifest, but I have no idea where the foreground services are coming from. Therefore, I do not know how to declare my Manifest properly.

  1. android.permission.ACCESS_COARSE_LOCATION
  2. android.permission.ACCESS_FINE_LOCATION
  3. android.permission.ACCESS_MEDIA_LOCATION
  4. android.permission.ACCESS_NETWORK_STATE
  5. android.permission.ACCESS_WIFI_STATE
  6. android.permission.BLUETOOTH
  7. android.permission.BLUETOOTH_ADMIN
  8. android.permission.BLUETOOTH_SCAN
  9. android.permission.CAMERA
  10. android.permission.FOREGROUND_SERVICE_LOCATION
  11. android.permission.INTERNET
  12. android.permission.NFC
  13. android.permission.POST_NOTIFICATIONS
  14. android.permission.READ_EXTERNAL_STORAGE
  15. android.permission.READ_PHONE_STATE
  16. android.permission.RECEIVE_BOOT_COMPLETED
  17. android.permission.WAKE_LOCK
  18. android.permission.WRITE_EXTERNAL_STORAGE
  19. com.google.android.c2dm.permission.RECEIVE
  20. com.symbol.emdk.permission.EMDK

I am grateful for any support.

Margueritamarguerite answered 7/2 at 20:55 Comment(0)
S
6

Check the merged manifest, the permission is probably coming from a library you used.

You can see it directly on Android studio https://developer.android.com/build/manage-manifests#inspect_the_merged_manifest_and_find_conflicts

Sparerib answered 7/2 at 22:21 Comment(4)
Thank you. In the merged manifest file, the android.permission.FOREGROUND_SERVICE_LOCATION is listed below our added com.symbol.emdk.permission.EMDK. Apparently, the Zebra SDK uses it. And we use it in every single Action. FML.Margueritamarguerite
@Isidro Rodriguez I am also getting the same in my react native android app. I am using expo. Can you help me please?Colloquial
@HabiburRahman, I think it's better if you post a new question and share the details there, so me and others can helpSparerib
@IsidroRodriguez Here is my new question #77994225 Please helpColloquial

© 2022 - 2024 — McMap. All rights reserved.