npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cordova-android-play-services-gradle

v2.0.1

Published

Cordova/Phonegap plugin to align various versions of the Play Services library specified by other plugins to a specific version

Readme

cordova-android-play-services-gradle-release Latest Stable Version Total Downloads

This Cordova/Phonegap plugin for Android aligns various versions of the Play Services library specified by other plugins to a specific version.

Table of Contents

Purpose

TL;DR: To prevent build failures caused by including different versions of the Play Services library.

Some Cordova plugins include the Play Services library to faciliate them. Most commonly, these are now included into the Cordova project by specifying them as Gradle dependencies (see the Cordova plugin spec documenation).

Example plugins:

The problem arises when these plugins specify different versions of the Play Services library. This can cause build failures to occur, which are not easy to resolve without changes by the plugin authors to align the specified versions. See these issues:

To resolve these version collisions, this plugin injects a Gradle configuration file into the native Android platform project, which overrides any versions specified by other plugins, and forces them to the version specified in its Gradle file.

If you're encountering similar problems with the Android Support and/or Firebase libraries, checkout the sister plugins:

Caveats

Other plugins that reference the Firebase library

Other plugins that reference the Google Services plugin

  • There are certain Cordova plugins which reference the Google Services plugin in their Gradle config, for example:
  • The Google Services plugin itself references a particular version of the Play Services library
    • The version of Play Services library referenced depends on the version of the Google Services plugin referenced by the Cordova plugin.
  • If a plugin (such as cordova-plugin-fcm) is included into a Cordova project along with this plugin, then this plugin is unable to override the Play Services library version specified by the Google Services plugin.
  • Attempting to do result with result in a build failure with an error message such as Found com.google.android.gms:play-services-location:12.+, but version 9.0.0 is needed for the google-services plugin.
  • The only here solution you can implement using this plugin is to specifiy the same version as required by the Google Services plugin
    • In the example error above, that would mean installing this plugin with: cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=9.0.0

Installation

$ cordova plugin add cordova-android-play-services-gradle-release
$ cordova plugin add cordova-android-play-services-gradle-release  --variable PLAY_SERVICES_VERSION={required version}

The plugin needs to be installed with the cordova-fetch mechanism in order to satisfy its package dependencies by installing it via npm.

Therefore if you're installing with cordova@6, you'll need to explicitly specify the --fetch option:

$ cordova plugin add cordova-android-play-services-gradle-release --fetch   

Library versions

Default version

By default, this plugin will use the most recent major version the Play Services library: The current default set by this plugin is: 15.+

$ cordova plugin add cordova-android-play-services-gradle-release

Other versions

In some cases, you may want to specify a different version of the Play Services library - see here for a list recent versions. So this plugin enables you to specify other versions of the Play Services library using the PLAY_SERVICES_VERSION plugin variable.

For example, if you want to install v10 of the Play Services library, you'd specify the version via the variable:

cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=10.+

Example

Uses v10 of the Play Services library to fix the build issue.

  1. cordova create test1 && cd test1/
  2. cordova platform add android@latest
  3. cordova plugin add [email protected]
  4. cordova compile

Observe the build succeeds and in the console output is v10.2.6 of Play Services library:

:prepareComGoogleAndroidGmsPlayServicesBase1026Library
  1. cordova plugin add [email protected]
  2. cordova compile

Observe the build failed and in the console output is higher than v10.2.6 (e.g v11) of Play Services library:

:prepareComGoogleAndroidGmsPlayServicesBase1100Library
  1. cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=10.+
  2. cordova prepare && cordova compile

Observe the build succeeds and in the console output is v10 of Play Services library.

Credits

Thanks to Chris Scott, Transistor Software for his idea of extending the initial implementation to support dynamic specification of the library version via a plugin variable in cordova-google-api-version

License

The MIT License

Copyright (c) 2017 Dave Alden / Working Edge Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.