rockfight rockfight - 4 months ago 23
Android Question

Why apps asks permission without writing it in manifest

I have an app in which the manifest have only following lines in permission

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


But while installing the app the play store shows following permissions

Identity

Uses one or more of: accounts on the device, profile data

Location

Uses the device's location

Photos/Media/Files

Uses one or more of: files on the device such as images, videos, or audio, the device's external storage

Since I am not asking for user location neither I am using it, why play store is showing this ?

Edit:how to fix

The link on accepted answer and this google page helped me solve the issue. Basically play-services used location so I just replaced them with service-plus and service-ads which solved the issue. Hope this will help some other developers.

Specifically

replace
compile 'com.google.android.gms:play-services:7.5.0'


with

compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.google.android.gms:play-services-plus:7.5.0'

Answer

Since I am not asking for user location neither I am using it, why play store is showing this ?

It's shows what your app requires, even you did not put it explicitly in your Manifest file. In fact the final Manifest is a result of merge of your AndroidManifest.xml and all the manifests used dependencies (these usually referenced via gradle's compile ...) provide.

If you wonder which dependency contributes to your final permission requirements, you can check manifest merger report file (check <PROJECT>\app\build\outputs\logs folder and check for uses-permission#PERMISSION, i.e.:

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

Here's official documentation chapter to read: Merge Multiple Manifest Files and additonally blog post you may also want to check too: Hey, Where Did These Permissions Come From?