为什么我的应用说我要求联系人的许可?

问题描述 投票:4回答:3

我有一个表面应用程序,说我要求联系人的权限...但我不是。我无法弄清楚为什么这是......

我有应用内结算功能,可访问Google适配数据以及Google Analytics。

以下是清单中的权限列表:

<!-- Normal Permissions -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="com.android.vending.BILLING" />

    <!-- Dangerous Permissions -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <!-- Permissions required by the wearable app -->
    <uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

以下是此应用权限的Play商店列表:

In-app purchases
Identity
find accounts on the device
Contacts
find accounts on the device
Location
precise location (GPS and network-based)
approximate location (network-based)
Photos/Media/Files
modify or delete the contents of your USB storage
read the contents of your USB storage
Storage
modify or delete the contents of your USB storage
read the contents of your USB storage
Other
receive data from Internet
full network access
view network connections
run at startup
prevent device from sleeping
use accounts on the device

应用程序依赖项:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    wearApp project(':Wearable')
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.support:wearable:1.3.0'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
    compile files('libs/httpclient-4.5.1.jar')
    compile files('libs/apache-httpcomponents-httpclient.jar')
    compile files('libs/apache-httpcomponents-httpclient-cache.jar')
    compile files('libs/apache-httpcomponents-httpcore.jar')
    compile files('libs/apache-httpcomponents-httpmime.jar')
    compile files('libs/GoogleConversionTrackingSdk-2.2.4.jar')
    compile files('libs/feedback_v6.jar')
}

磨损依赖:

dependencies {
    compile 'com.google.android.support:wearable:1.3.0'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.android.support:support-v13:23.1.0'
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
}
android android-contacts android-permissions
3个回答
9
投票

在我的一个应用程序中,我遇到了一个问题,即我的应用程序要求获取我从未要求的权限,原因就是Google Play服务。

我们必须明确提及我们的应用需要哪些Google Play服务。例如,如果我们需要广告,我们需要使用

com.google.android.gms:播放服务的广告:8.4.0

并不是

com.google.android.gms:播放服务:8.4.0

然后,即使我们的应用程序不需要,Google Play服务也会要求获得所有服务的许可。

请检查https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project并仅使用您需要的内容,看看是否能解决您的问题。

在您的情况下,我怀疑,Google帐户登录是联系的原因。

希望这可以帮助。祝一切顺利。


5
投票

来自@Natarajan Raman的好建议!!我只是想补充一下来自@CommonsWare的一篇很棒的文章,Hey, Where Did These Permissions Come From?解释了这个问题。

引用文章:

您可能会发现自己处于需要依赖关系的情况,但您不希望依赖关系所需的权限。您可以尝试阻止合并过程的权限,方法是在您自己的清单中(例如,在主源集中)使用工具:node =“remove”:

因此,如果您只遇到“联系人”权限问题,则可以在“清单”中添加:

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

并且将删除不需要的权限。

希望这可以帮助!!!


0
投票

固定!!!

将依赖项更改为:

    compile 'com.google.android.gms:play-services-fitness:8.3.0'
    compile 'com.google.android.gms:play-services-wearable:8.3.0'
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
    compile 'com.google.android.gms:play-services-appindexing:8.3.0'

代替:

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

奖金:也使我的应用程序小得多!

© www.soinside.com 2019 - 2024. All rights reserved.