Why is the Google Play Store asking for permissions not in my Manifest?

与世无争的帅哥 提交于 2019-12-12 07:23:36

问题


I think this may have to do with the ManifestMerger.

My AndroidManifest.xml permissions:

<uses-permission android:name="android.permission.INTERNET" />

However the app is asking for:

Identity Location Photos/Media/Files

The manifest-merger-release.txt says:

uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
ADDED from com.google.android.gms:play-services-maps:7.5.0:22:5
uses-permission#android.permission.ACCESS_COARSE_LOCATION
ADDED from com.google.android.gms:play-services-maps:7.5.0:23:5
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

But my app is not using google maps etc...

Update:

build.gradle:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    defaultConfig {
        ...
    }
    signingConfigs {
        release {
            ...
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
}

repositories {
    maven { url "https://jitpack.io" }
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.google.android.gms:play-services:7.5.0'
    compile 'com.github.PhilJay:MPAndroidChart:034e05997d'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile('com.crashlytics.sdk.android:crashlytics:2.2.3@aar') {
        transitive = true;
    }
    compile 'com.squareup.okhttp:okhttp:2.3.0'
    compile 'com.jakewharton:butterknife:6.1.0'
}

回答1:


You can change the compile 'com.google.android.gms:play-services:7.5.0' in your build.gradle to the specific part of the play services you need.

Take a look at https://developers.google.com/android/guides/setup

On this way, the play services doesn't add non-needed permissions

Example:

To use Google Cloud Messaging, just use com.google.android.gms:play-services-gcm:7.5.0



来源:https://stackoverflow.com/questions/31582471/why-is-the-google-play-store-asking-for-permissions-not-in-my-manifest

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