Giter Club home page Giter Club logo

cordova-android-play-services-gradle-release's Introduction

cordova-android-play-services-gradle-release

This Cordova/Phonegap plugin for Android aligns various versions of the Play Services library specified by other plugins to the latest release (or 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 libraries, checkout the sister plugin: cordova-android-support-gradle-release.

Installation

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

Just install the plugin and that's it. It should fix should build.

Different library versions

Default version

By default, the master branch of this repo and corresponding npm release, will be made to specify the most major version of the most recent release of the Play Services library - see here for a list recent versions.

Other versions

In some cases, you may want to specify a different version of the Play Services library. So this plugin provides branches for various older major versions of the Play Services library.

Because Cordova doesn't support tags in plugins sourced from npm, you'll need to install this version directly from the git repo:

cordova plugin add https://github.com/dpa99c/cordova-android-play-services-gradle-release#v10

The following branches currently exist:

  • master (default)
    • The most recent major release
    • Currently uses 11.+
    • Install with: cordova plugin add cordova-android-play-services-gradle-release
    • Or: https://github.com/dpa99c/cordova-android-play-services-gradle-release
  • edge
    • The most recent release
    • Uses +
    • Install with: cordova plugin add https://github.com/dpa99c/cordova-android-play-services-gradle-release#edge
  • v11
    • The highest v11 version
    • Uses 11.+
    • Install with: cordova plugin add https://github.com/dpa99c/cordova-android-play-services-gradle-release#v11
  • v10
    • The highest v10 version
    • Uses 10.+
    • Install with: cordova plugin add https://github.com/dpa99c/cordova-android-play-services-gradle-release#v10
  • v9
    • The highest v9 version
    • Uses 9.+
    • Install with: cordova plugin add https://github.com/dpa99c/cordova-android-play-services-gradle-release#v9

Example

Forces the latest release version 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.0.0) of Play Services library:

:prepareComGoogleAndroidGmsPlayServicesBase1100Library
  1. cordova plugin add cordova-android-play-services-gradle-release
  2. cordova compile

Observe the build succeeds and in the console output is latest release version of Play Services library.

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.

cordova-android-play-services-gradle-release's People

Contributors

chr4ss1 avatar dpa99c avatar kodeine avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.