ACCESS_COARSE_LOCATION merged from play-services-base lib

701 views Asked by At

I'm using Android Studio to build my project, and after looking at the manifest-merger-debug-report.txt file, I see the following permission was added to my manifest:

ADDED from com.google.android.gms:play-services-base:7.5.0:22:13
uses-permission#android.permission.ACCESS_COARSE_LOCATION

It seems as if play-services lib merged the ACCESS_COARSE_LOCATION permission to my manifest. I am using the play services in order to support GCM in my library (play-services-gcm). I've been using the play-services lib for a long time, until the recent update of the lib, which seemed to add this permission for some reason. This is obviously not wanted on my end, as less users will trust my app.

Is there anyway I can still use the lib, without this unnecessary permission?

2

There are 2 answers

0
Tom Redman On

Google Play services 7.5 automatically adds required permissions - when you use com.google.android.gms:play-services - that says you are using every part of Google Play services, potentially adding more permissions than you intended.

You may need to selectively compile just the Google Play Service APIs you need.

Here is a link to the separated libs, and here is the list as it was at time of writing:


Google+ com.google.android.gms:play-services-plus:7.5.0

Google Account Login com.google.android.gms:play-services-identity:7.5.0

Google Actions, Base Client Library com.google.android.gms:play-services-base:7.5.0

Google App Indexing com.google.android.gms:play-services-appindexing:7.5.0

Google App Invites com.google.android.gms:play-services-appinvite:7.5.0

Google Analytics com.google.android.gms:play-services-analytics:7.5.0

Google Cast com.google.android.gms:play-services-cast:7.5.0

Google Cloud Messaging com.google.android.gms:play-services-gcm:7.5.0

Google Drive com.google.android.gms:play-services-drive:7.5.0

Google Fit com.google.android.gms:play-services-fitness:7.5.0

Google Location, Activity Recognition, and Places com.google.android.gms:play- services-location:7.5.0

Google Maps com.google.android.gms:play-services-maps:7.5.0

Google Mobile Ads com.google.android.gms:play-services-ads:7.5.0

Google Nearby com.google.android.gms:play-services-nearby:7.5.0

Google Panorama Viewer com.google.android.gms:play-services-panorama:7.5.0

Google Play Game services com.google.android.gms:play-services-games:7.5.0

SafetyNet com.google.android.gms:play-services-safetynet:7.5.0

Google Wallet com.google.android.gms:play-services-wallet:7.5.0

Android Wear com.google.android.gms:play-services-wearable:7.5.0

0
Valentin On

Add

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

to your main manifest to remove this permission.