Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PlayServices ads library 7.5.0 need WRITE_EXTERNAL_STORAGE permission [duplicate]

In our build.gradle we updated the play-services ads library from 6.5.87 to 7.5.0

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

After upgrading we see a new permission in our merged AndroidManifest.xml (placed in /build/intermediates/manifests/full/release/)

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

Regarding the log of the ManifestMerger this permission is added by play-services-ads:

ADDED from com.google.android.gms:play-services-ads:7.5.0:30:9
    android:theme
ADDED from com.google.android.gms:play-services-ads:7.5.0:31:13
    android:name
ADDED from com.google.android.gms:play-services-ads:7.5.0:30:19
    uses-permission#android.permission.WRITE_EXTERNAL_STORAGE

In the official documentation, we do not see any hint that this permission is needed. Only the following permissions are documented:

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

(https://developers.google.com/mobile-ads-sdk/docs/dfp/android/quick-start#modifying_the_android_manifest)

Is there any official information, why this new permission was added? Or is this a bug?

Currently we have trouble to explain our users, why we need this new permission.

EDIT: Wrong alarm! I was misinterpreting the manifest-merger-result.txt. The new permission was not added by the play-services-ads dependency, but we also added the play-services-location dependency. The play-services-location has a reference to play-services-maps, which needs this permission for caching the tiles.

The correct interpretation of the manifest-merger-result.txt is:

uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
ADDED from com.google.android.gms:play-services-maps:7.5.0:22:5

The play-services-maps automatically add this "missing" permission, if the lib was added. It would be nice to know, if it is a good idea to remove this map-permissions, if we do not use the Map-API. Because we are only using the Location-API.

like image 901
Christopher Avatar asked Jul 01 '15 12:07

Christopher


1 Answers

This was fixed as part of Google Play services 8.3 - the Maps API (which location relies on) no longer requires the storage permission and no longer adds it via manifest merger.

like image 162
ianhanniballake Avatar answered Sep 28 '22 06:09

ianhanniballake