Android permissions GET_ACCOUNTS and USE_CREDENTIALS show up automatically

自作多情 提交于 2019-12-08 17:45:12

问题


It has been quite a few months since I had time to work on my app. And today I downloaded latest Android Studio and SDK, I found a problem after I built the app.

My AndroidManifest file does NOT require any permissions on GET_ACCOUNTS or USE_CREDENTIALS, however they are shown as new added permissions when I tried to upload the app in Google Play store. I did use Google Play Games service in the game, but it was not like this before I did this update.

Does anybody know why? I Googled a while but could not find any clue..


回答1:


If you recently updated, check to see if you switched to Google Play services 7.5 with a line in your build.gradle file such as

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

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.

Instead, you should selectively include what APIs you use by using separate dependencies such as:

compile 'com.google.android.gms:play-services-games:7.5.0'
compile 'com.google.android.gms:play-services-drive:7.5.0'

(Assuming you'd need Drive for Saved Games support)



来源:https://stackoverflow.com/questions/30699993/android-permissions-get-accounts-and-use-credentials-show-up-automatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!