我的Android应用程序请求位置权限我没有要求

时间:2015-08-02 11:04:25

标签: android android-location android-permissions

在构建之后查看最终的清单,它包含两个我没有要求的额外权限。 WRITE_EXTERNAL_STORAGE和ACCESS_COURSE_LOCATION。

我正在运行gradle构建。我看到另一篇文章说要使用minSdkVersion声明一个uses-sdk部分但是没有帮助。 这是我试过的:

<uses-sdk
    android:minSdkVersion="17"
    android:targetSdkVersion="21" />

我还查看了所有依赖项的清单,但是我没有看到任何可以添加它的内容。

com.crashlytics.sdk.android:crashlytics:2.5.0@aar
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:support-v13:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.google.android.gms:play-services-identity:7.5.0'
compile 'com.google.android.gms:play-services-analytics:7.5.0'
compile 'com.sababado.circularview:library:1.0.0'

权限来自哪里?

2 个答案:

答案 0 :(得分:3)

应用清单列出了您的应用所需的内容,即使您没有明确地将其明确放在您的清单文件中。事实上,最终的Manifest是您的AndroidManifest.xml和所有使用依赖项的清单(这些通常通过gradle&#39; s compile ...提供)合并的结果。

如果您想知道哪个依赖项会影响您的最终权限要求,您可以检查清单合并报告文件(选中<PROJECT>\app\build\outputs\logs文件夹并检查uses-permission#PERMISSION,即:

uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
ADDED from AndroidManifest.xml:11:5
MERGED from com.google.android.gms:play-services-maps:7.5.0:22:5

在这篇博客文章中,您可能还想查看:Hey, Where Did These Permissions Come From?

答案 1 :(得分:0)

Google Play服务可能已经请求了该许可。如您所知,它根据位置和国家/地区显示用户数量。