Solved

Is it possible to remove Android COARSE_LOCATION permission?

  • 27 September 2022
  • 8 replies
  • 408 views

Badge

Hey community! 🖐 I recently added Amplitude to my Android project, and I’m now getting this warning in the Play Store when I upload a new bundle containing Amplitude. After digging into my merged manifest, I found that it was indeed Amplitude that had added the “COARSE_LOCATION” permission. I know that I can disable various tracking options, but is there a way to disable them and remove this permission from our app, yet still use Amplitude?

 

 

icon

Best answer by Denis Holmes 30 September 2022, 11:24

View original

8 replies

Userlevel 6
Badge +8

Hi @slumbergroup ,

 

Can you let me know which version of the Android SDK you are using? I know you can disable location tracking but I am not too sure if you can completely remove the permission. I believe Amplitude will still work, but it would be difficult to identify some users and their locations. However, applying trackingOption APIs for latlng will do the job not to report location data.

 

For Android SDK, there is V 2.25.1 https://github.com/amplitude/Amplitude-Android/releases/tag/v2.25.1 to address this issue. It won’t add location permissions anymore to manifest file. I hope this helps!

 

Kind Regards,
Denis

Badge

I’m currently using the latest Android Kotlin SDK (according to the installation guidelines here). I might try switching over to the Android SDK you suggested instead!

Userlevel 6
Badge +8

Hi @slumbergroup ! Android SDK is legacy so I would try to stick with Android Kotlin SDK, but you should be able to still use the SDK but some things may not be tracked. Let me ask this internally and I will get back to you!

Badge

Thanks for letting me know @Denis Holmes. It is a bit older than we’d like to use, so if you don’t happen upon a solution, we might just have to request it of our users!

Userlevel 6
Badge +8

Hey @slumbergroup !

 

I got a reply from our Engineers! You can still use the Kotlin Android SDK without this permission, but the country field will be empty.
I am also sharing where they found the code:

Thanks!

Badge

Thank you for the help, @Denis Holmes!

Badge

@Denis Holmes I actually found a solution to removing the permission from our app. Not sure why it was so difficult to find, but it’s actually incredibly simple. You can just add a “remove” command within your App’s Manifest as follows:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove"/>

Cheers!

Userlevel 6
Badge +8

Indeed, as I said above “You can still use the Kotlin Android SDK without this permission”. Glad you found it!

Reply