Skip to main content
Solved

Is it possible to remove Android COARSE_LOCATION permission?

  • September 27, 2022
  • 8 replies
  • 824 views

Forum|alt.badge.img

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?

 

 

Best answer by Denis Holmes

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!

View original
Did this topic help you find an answer to your question?

8 replies

Denis Holmes
Team Member
Forum|alt.badge.img+8
  • Team Member
  • 448 replies
  • September 28, 2022

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


Forum|alt.badge.img
  • Author
  • Novice
  • 4 replies
  • September 28, 2022

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!


Denis Holmes
Team Member
Forum|alt.badge.img+8
  • Team Member
  • 448 replies
  • September 29, 2022

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!


Forum|alt.badge.img
  • Author
  • Novice
  • 4 replies
  • September 29, 2022

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!


Denis Holmes
Team Member
Forum|alt.badge.img+8
  • Team Member
  • 448 replies
  • Answer
  • September 30, 2022

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!


Forum|alt.badge.img
  • Author
  • Novice
  • 4 replies
  • October 3, 2022

Thank you for the help, @Denis Holmes!


Forum|alt.badge.img
  • Author
  • Novice
  • 4 replies
  • October 13, 2022

@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!


Denis Holmes
Team Member
Forum|alt.badge.img+8
  • Team Member
  • 448 replies
  • October 13, 2022

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings