1

Recently, Google started complaining about my App (which is in Alpha in Play store) using android.permission.GET_ACCOUNTS and thus needs to have a link to "a valid privacy policy". Now I don't have that since my app is still in alpha, but even more strange is that I don't require the android.permission.GET_ACCOUNTS permission in my Manifest.

I'm listing the permissions I DO require below,

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<permission android:name="xxx.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="xxx.permission.C2D_MESSAGE" />

<permission android:name="xxx.permission.INTERNAL_NOTIFICATION" android:protectionLevel="signature" />
<uses-permission android:name="sxxx.permission.INTERNAL_NOTIFICATION" />

as well as my Gradle dependencies:

apply plugin: 'com.google.gms.google-services'

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

// Support Library
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'

// Google Play Services (Push notifications)
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'

// Calligraphy (Font)
compile 'uk.co.chrisjenx:calligraphy:2.2.0'

// Smack (XMPP client)
compile 'org.igniterealtime.smack:smack-android:4.1.1'
compile 'org.igniterealtime.smack:smack-tcp:4.1.1'

// AndroidPlot (Charts)
compile 'com.androidplot:androidplot-core:0.6.1'

// Test Targets
testCompile('junit:junit:4.12', 'org.mockito:mockito-core:1.9.5')
testCompile 'org.json:json:20140107'

and I'm thankful if someone could point out where android.permission.GET_ACCOUNTS comes from.

Joakim
  • 3,224
  • 3
  • 29
  • 53
  • 3
    **Wild guess**: from the Play Services? – Phantômaxx Dec 20 '16 at 13:02
  • 1
    Yes, my own wild guess would also be on Play services, but I haven't found any reference to that being the case. Neither do I understand why I should provide the privacy policy for it: "We use Play Services to deliver notifications. They use your account for some obscure reason" – Joakim Dec 20 '16 at 13:13
  • 1
    https://stackoverflow.com/questions/30546197/android-studio-adds-unwanted-permission-after-running-application-on-real-device – CommonsWare Dec 20 '16 at 13:14
  • 1
    Also, get rid of `compile 'com.google.android.gms:play-services:8.3.0'`. Or, get rid of the other `play-services-...` dependencies. `com.google.android.gms:play-services:8.3.0` is all of the Play Services SDK, which most likely is not what you want. But, if it is, it is superfluous to say "give me everything, and then give me a second copy of ads, identity, and GCM". – CommonsWare Dec 20 '16 at 13:16
  • @CommonsWare that sounds possible. I will try it. – Joakim Dec 20 '16 at 13:57

3 Answers3

1

Remove this dependency:

compile 'com.google.android.gms:play-services:8.3.0'

It is (a) redundant, (b) includes a HUGE number of services you don't use which is inflating your app's size and method count substantially, and (c) will include every play service's permission set - including GET_ACCOUNTS.

Your other play service dependencies will pull in the core play services libraries they need independently.

Tom
  • 6,946
  • 2
  • 47
  • 63
0

Do a text search in the whole project for android.permission.GET_ACCOUNTS (Ctrl+Shift+F) in Android Studio. It might show you what adds this permission requirement.

Marcin Kunert
  • 5,596
  • 5
  • 26
  • 52
0

By looking at your Gradle dependencies , You are using GCM message Notification service right.?

So this scenario is pretty well explained in the accepted ans in below link:

GET_ACCOUNTS permission while using GCM - Why is this needed?

Community
  • 1
  • 1
Sunny
  • 58
  • 6
  • Yes, the answer in that link says GCM uses `android.permission.GET_ACCOUNTS` on pre-ICS devices. My app uses minimum SDK 16. – Joakim Dec 20 '16 at 13:52
  • Quoting one of the answers, "The GET_ACCOUNTS permission is no longer needed for GCM to work" (Oct 2013) – Joakim Dec 20 '16 at 13:52
  • great so your problem solved.? if yes then mark my ans as accepted or remove your question because it already had an ans. @Joakim – Sunny Dec 20 '16 at 13:56
  • What? You did not answer my question. – Joakim Dec 20 '16 at 14:00