Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Manifest Permissions External Storage

I have the below permissions defined in the Manifest but I still see Android asking the app needs permission to write to External storage even though I don't want to access External Storage

Could it be because of Google Play services

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
like image 833
i_raqz Avatar asked Sep 21 '15 04:09

i_raqz


4 Answers

Pls try This for google play service error:

  <uses-permission
         android:name="android.permission.WRITE_EXTERNAL_STORAGE"
         android:maxSdkVersion="Version code" />

Metadata used end of application.

like image 189
Hemina Avatar answered Nov 15 '22 23:11

Hemina


It's almost a year since post publication but maybe this'll help someone. If you are using play-services version < 8.3 then play-services-maps uses this permission.

If you are not using play-services-maps then probably you are using play-services-fitness which takes maps as transitive dependency.

If you are not using nor of them, then probably you have other transitive dependency which needs this permission.

TIP to check transitive dependencies

like image 2
promanowicz Avatar answered Nov 16 '22 00:11

promanowicz


Add these permissions

<uses-permission android:name="ANDROID.PERMISSION.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="ANDROID.PERMISSION.WRITE_EXTERNAL_STORAGE"/>
like image 1
dileep Avatar answered Nov 16 '22 00:11

dileep


This might be because of below two reason.

  1. If you're targeting version 8.3 or later of the Google Play services SDK, you no longer need the WRITE_EXTERNAL_STORAGE permission to use the Google Maps Android API.
  2. If you're targeting earlier versions of the Google Play services SDK, you must request the android.permission.WRITE_EXTERNAL_STORAGE permission.

Check this link.

  1. There was a bug in Google play services that causes unintended WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE, and READ_PHONE_STATE permissions to be merged into app manifests. That is solved in Google Play services 10.0 release. Check this.

To avoid this I recommend to include necessary individual Play service APIs and corresponding build.gradle descriptions. Check this.

Hope this will help you and future user also.

like image 1
Pravin Divraniya Avatar answered Nov 15 '22 23:11

Pravin Divraniya