Google Maps No Longer Requires STORAGE Permission!

Tahsin Dane
Oct 18, 2015 · 3 min read

Update: With the release of Google Play Services 8.3, the need for the Storage permission is completely dropped. You can safely remove the permission completely now. Here is the official documentation:

If you’re targeting version 8.3 or later of the Google Play services SDK, you no longer need theWRITE_EXTERNAL_STORAGE permission to use the Google Maps Android API.

For a long time, Google Maps Android SDK requires us to have WRITE_EXTERNAL_STORAGE permission. It was not the case when they first released the SDK. About 2 years ago, I was using the Maps fine in my application and suddenly with an update, I had the following crash:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tasomaniac.example/com.tasomaniac.example.MapActivity}: java.lang.SecurityException: The Maps API requires the additional following permissions to be set in the AndroidManifest.xml to ensure a correct behavior:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
.
.

I didn’t want to have that storage permission first. In fact, I worked too hard to avoid that. I desperately added the permission with no luck. Even worse, it blocked our auto-update in Google Play because we had a new permission.

For years, we lived with that.

The permission description says that the application can access files on the devices such as images, videos or audio.

Play Store Dialog with WRITE_EXTERNAL_STORAGE permission

I had lots of 1 stars in my app because of this. Users say that “Why do you request access for my photos and videos?”. They are right! They are always right. I don’t want to access your photos and I won’t. I am forced to have that permission.

Android Marshmallow brought us runtime permissions. They are great! Users do not see permissions when they install or update the app. Users have more control over the app’s functionality; for example, a user could choose to give a camera app access to the camera but not to the device location.

But imagine you have an app with Google Maps integration, and imagine you have to request WRITE_EXTERNAL_STORAGE on runtime to show the map. How would you explain that to users? Runtime permissions that are not obvious and require explanation are the worse. This is one of them.

Fortunately, they fixed the issue and removed storage permission. But not for all, just for Android Marshmallow.

If you use Google Maps and you want to target Android Marshmallow, this is what you need to do:

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

They also say in the documentation that they will remove it completely in the next release.

From the next release of the Google Play services SDK, the requirement for the WRITE_EXTERNAL_STORAGE permission will be completely dropped from the Google Maps Android API.

Conclusion

Please do the described changes in your application if you have Google Maps and want to target Android M!

I will update the post when they remove the permission necessity for good.

Note: Here is a great talk by Ian Lake from Big Android BBQ 2015 about Storage Permission in general: https://www.youtube.com/watch?v=C28pvd2plBA

Follow me on Twitter, Google+ and Medium.

Google Developers Experts

Experts on various Google products talking tech.

Google Developers Experts

Experts on various Google products talking tech.

Tahsin Dane

Written by

twitter.com/tasomaniac

Google Developers Experts

Experts on various Google products talking tech.