# Play Services 5.0 Is A Monolith Abomination

DevFeed: [Play Services 5.0 Is A Monolith Abomination](<https://devfeed.tech/articles/play-services-5-0-is-a-monolith-abomination-20953.md>)

Original publisher: [Read original article](<https://jakewharton.com/play-services-is-a-monolith/>)

Published: 2014-07-03T00:00:00Z

Content type: opinion

Language: en

Sources: [Jake Wharton](<https://devfeed.tech/sources/jake-wharton.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Google](<https://devfeed.tech/topics/google.md>), [Library](<https://devfeed.tech/topics/library.md>), [Dependency management](<https://devfeed.tech/topics/dependency-management.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [apis](<https://devfeed.tech/tags/apis.md>), [apk](<https://devfeed.tech/tags/apk.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [google](<https://devfeed.tech/tags/google.md>), [google-play](<https://devfeed.tech/tags/google-play.md>), [modular](<https://devfeed.tech/tags/modular.md>), [packages](<https://devfeed.tech/tags/packages.md>), [partitioning](<https://devfeed.tech/tags/partitioning.md>)

## AI overview

The article argues that Google Play Services 5.0 is an unnecessarily large monolithic Android library, contributing more than 20,000 methods toward the dex 64K limit. It calls for unbundling the disparate services into small, composable artifacts with simpler dependency configuration.

## Source excerpt

Guava is a monolithic library, but that's not necessarily a bad thing. Nobody thinks twice when bundling it for the JVM. In the world of Android the mention of Guava has a bit of a negative stigma due to the dex file format's method limit and a concern about bloating APK size. The latter is no longer a valid argument. The dex method limit is a hard 64k limit to which Guava contributes just over 14k methods. 20% of this hard limit vanishes when you include Guava. Sounds scary, right? It isn't. Google Play Services 5.0 which just launched contributes over twenty thousand methods to your app. 20k+. One third of the limit! Now that is scary. The Play Services library includes proprietary functionality built on the normal Android APIs and a separate APK downloaded on all devices with the Play Store. Some of the services it provides are invaluable. Like Guava it is also a monolothic library but it is a bad thing in this case. A lot of really cool functionality is being put in Play Services. You'll have a hard time making a compelling app that lives in the Google Play ecosystem without it. You should want to put it in your applications and not have to worry about the overhead it brings. Most of the library's offerings are very disparate, having only the fact that they're by Google as a common thread. This screams for small, modular artifacts which can be composed! Google, it's time to unbundle. All the cool kids are doing it. (Spoiler alert: it happened) At worst, we specify a few dependencies manually: dependencies { compile 'com.google.android.gms:play-services-ads:5.0.+' compile 'com.google.android.gms:play-services-analytics:5.0.+' compile 'com.google.android.gms:play-services-games:5.0.+' } Best case would be a plugin that provided a clear DSL to what you were getting and offered easier configuration of the various components. apply plugin: 'com.google.playservices' playServices { version '5.0.+' components 'ads', 'analytics', 'games' } (You can even still provide the