无需请求即可在Android中联系权限

时间:2017-03-16 23:38:24

标签: android android-permissions

我的Android应用程序显示即使我没有明确请求,也需要CONTACTS权限。

这是AndroidManifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.myapp.package"
    android:versionCode="2"
    android:versionName="1.1" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="19" />

    <permission
        android:name="com.myapp.package.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.myapp.package.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <permission
        android:name="com.myapp.package.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.myapp.package.permission.MAPS_RECEIVE" />

    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />
<>

来自build.gradle:

compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services:+'

// SwipeLayout
// https://github.com/daimajia/AndroidSwipeLayout
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:support-v4:20.+'
compile 'com.daimajia.swipelayout:library:1.2.0@aar'

// Crashlytics
compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
    transitive = true;

如何找到添加联系人权限的原因?

我检查了Why does my app say I am requesting permission for Contacts?并交叉检查了我的播放服务依赖项。它没有解决问题。

1 个答案:

答案 0 :(得分:1)

根据X3Btel和CommonsWare的建议,以下更改有效:

compile&#39; com.android.support:support-v4:23.4.0&#39;     编译&#39; com.android.support:appcompat-v7:23.4.0&#39;

// Google Analytics
compile 'com.google.android.gms:play-services-analytics:9.4.0'

// Google Drive
compile 'com.google.android.gms:play-services-drive:9.4.0'

// Google Maps
compile 'com.google.android.gms:play-services-maps:9.4.0'

// SwipeLayout
// https://github.com/daimajia/AndroidSwipeLayout
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.daimajia.swipelayout:library:1.2.0@aar'