问题描述
我注意到当我在 build.gradle 文件中使用以下权限时,会自动添加以下权限
I noticed that the following permissions were automatically added when i use the following in my build.gradle file
compile 'com.google.android.gms:play-services:7.5.0'
早期版本的播放服务不会出现这种情况.有没有人有解决方案来删除这些不需要的权限?
This did not occur with the earlier versions of the play-services. does anyone have a solution to remove these unwanted permissions?
我只使用广告功能(INTERNET 和 ACCESSNETWORK_STATE).我不需要 LOCATION 和 USE_CREDENTIALS 权限.如何删除这些不需要的权限?
I am only using the ads function (INTERNET and ACCESSNETWORK_STATE). I got no need for the LOCATION and USE_CREDENTIALS permissions. How do you remove these unwanted permissions?
我注意到manifest-merger-xxx-debug-report.txt"文件包含以下内容
I noticed that the 'manifest-merger-xxx-debug-report.txt' file contains the following
...<snipped bunch of other merges>
MERGED from com.google.android.gms:play-services-maps:7.5.0:22:5
android:name
ADDED from com.google.android.gms:play-services-maps:7.5.0:22:22
uses-permission#android.permission.ACCESS_COARSE_LOCATION
ADDED from com.google.android.gms:play-services-maps:7.5.0:23:5
MERGED from com.google.android.gms:play-services-maps:7.5.0:23:5
MERGED from com.google.android.gms:play-services-maps:7.5.0:23:5
MERGED from com.google.android.gms:play-services-maps:7.5.0:23:5
android:name
ADDED from com.google.android.gms:play-services-maps:7.5.0:23:22
uses-feature#0x00020000
ADDED from com.google.android.gms:play-services-maps:7.5.0:24:5
MERGED from com.google.android.gms:play-services-maps:7.5.0:24:5
MERGED from com.google.android.gms:play-services-maps:7.5.0:24:5
MERGED from com.google.android.gms:play-services-maps:7.5.0:24:5
android:glEsVersion
ADDED from com.google.android.gms:play-services-maps:7.5.0:25:8
android:required
ADDED from com.google.android.gms:play-services-maps:7.5.0:26:8
android:uses-permission#android.permission.READ_EXTERNAL_STORAGE
IMPLIED from AndroidManifest.xml:2:1 reason: com.google.android.gms.maps requested WRITE_EXTERNAL_STORAGE
uses-permission#android.permission.GET_ACCOUNTS
ADDED from com.google.android.gms:play-services-wallet:7.5.0:21:5
android:name
ADDED from com.google.android.gms:play-services-wallet:7.5.0:21:22
uses-permission#android.permission.USE_CREDENTIALS
ADDED from com.google.android.gms:play-services-wallet:7.5.0:22:5
android:name
ADDED from com.google.android.gms:play-services-wallet:7.5.0:22:22
meta-data#com.google.android.gms.wallet.api.enabled
...<snips more lines away>
推荐答案
使用时
compile 'com.google.android.gms:play-services:7.5.0'
这意味着您正在使用 Google Play 服务的每一项功能,包括定位服务.如果您只需要特定的 API,则应使用选择性 API.
This implies you are using every feature of Google Play Services, including location services. If you only need a particular API, you should be using the selective APIs.
如果是广告,您可以单独使用:
In the case of ads, you can use solely:
compile 'com.google.android.gms:play-services-ads:7.5.0'
这篇关于为什么包含 Google Play 服务库时权限会自动添加到我的 AndroidManifest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!