Error Push Plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin'

Recently I am having error in phonegap push plugin while building the app .Such error never came before to me.
Waiting for you reply

**Error i am having**

A problem occurred evaluating root project ‘android’.

Failed to apply plugin [class ‘com.google.gms.googleservices.GoogleServicesPlugin’]
For input string: “+”

**My ionic configuration is :**

cli packages: (C:\Users\hybrid\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.10.2
ionic (Ionic CLI) : 3.10.3
global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.6.0

System:

Node : v6.11.2
npm  : 3.10.10
OS   : Windows 7

go to platforms>android>project.properties.
set same version for these libraries if they are in your file.
cordova.system.library.1=com.google.android.gms:play-services-auth:11.0.1
cordova.system.library.2=com.google.android.gms:play-services-identity:11.0.1
cordova.system.library.5=com.google.firebase:firebase-messaging:11.0.1

Well as you said i made changes to system.properties file:
Initialy the code was
target=android-25
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-badge/starter-badge.gradle
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.system.library.2=com.facebook.android:facebook-android-sdk:4.+
cordova.system.library.3=com.google.android.gms:play-services-maps:+
cordova.system.library.4=com.google.android.gms:play-services-location:+
cordova.system.library.5=com.android.support:support-v4:24.1.1+
cordova.gradle.include.2=cordova-android-play-services-gradle-release/starter-cordova-android-play-services-gradle-release.gradle

but now it is changed to :
target=android-25
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-badge/starter-badge.gradle
cordova.system.library.1=com.google.android.gms:play-services-auth:11.0.1
cordova.system.library.2=com.google.android.gms:play-services-identity:11.0.1
cordova.system.library.3=com.google.android.gms:play-services-maps:+
cordova.system.library.4=com.google.android.gms:play-services-location:+
cordova.system.library.5=com.google.firebase:firebase-messaging:11.0.1
cordova.gradle.include.2=cordova-android-play-services-gradle-release/starter-cordova-android-play-services-gradle-release.gradle

the error after made changes is

Please fix the version conflict either by updating the version of the google-services plugin (information
about the latest version is available at
Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog) or updating the version of
com.google.android.gms to 11.0.1.

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

go to platforms>android>build.gradle and paste this in bottom of the file


configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.1'
            }
        }
    }
}

After what you said Still not working.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    Error: cmd: Command failed with exit code 1 Error output:
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.

     FAILURE: Build failed with an exception.
    
     * What went wrong:
     Execution failed for task ':processDebugGoogleServices'.
     > Please fix the version conflict either by updating the version of the google-services plugin (information
     about the latest version is available at
     https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of
     com.google.android.gms to 11.0.1.
    
     * Try:
     Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    

Well i have update version of google play services which is 44.
Plugin List in package.json
"cordova-android": “^6.2.3”,
“cordova-android-play-services-gradle-release”: “^1.1.0”,
“cordova-plugin-actionsheet”: “^2.3.3”,
“cordova-plugin-badge”: “^0.8.1”,
“cordova-plugin-camera”: “^2.4.1”,
“cordova-plugin-compat”: “^1.1.0”,
“cordova-plugin-console”: “^1.0.5”,
“cordova-plugin-datepicker”: “^0.9.3”,
“cordova-plugin-device”: “^1.1.4”,
“cordova-plugin-facebook4”: “^1.9.1”,
“cordova-plugin-file”: “^4.3.3”,
“cordova-plugin-file-transfer”: “^1.6.3”,
“cordova-plugin-filepath”: “^1.0.2”,
“cordova-plugin-geolocation”: “^2.4.3”,
“cordova-plugin-googlemaps”: “git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#multiple_maps”,
“cordova-plugin-nativestorage”: “^2.2.2”,
“cordova-plugin-splashscreen”: “^4.0.3”,
“cordova-plugin-statusbar”: “^2.2.2”,
“cordova-plugin-whitelist”: “^1.3.1”,
“cordova-plugin-x-socialsharing”: “^5.2.0”,
“cordova-sqlite-storage”: “^2.0.4”,

Upgrade your google service plugin from android sdk manager.
After that, If you are using a firebase create your google-service.json file and download it. then add this file in your platforms->android path. These steps worked for me. I hope this will help you.

1 Like

project.properties

remove below line from the end of gradle file and make some other changes that is replace + with 11.8.0 for google and firebase versions

apply plugin: 'com.google.gms.google-services'
`
OLD code:
target=android-26
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-plugin-mauron85-background-geolocation/pushbase-logtofile.gradle
cordova.system.library.1=com.google.android.gms:play-services-location:11+
cordova.system.library.2=com.android.support:support-v4:23+
cordova.system.library.3=com.android.support:support-v13:26.+
cordova.system.library.4=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.5=com.google.firebase:firebase-messaging:11.6.2
cordova.gradle.include.2=phonegap-plugin-push/pushbase-push.gradle

**latest code:**
# Project target.
target=android-26
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-plugin-mauron85-background-geolocation/pushbase-logtofile.gradle
cordova.system.library.1=com.google.android.gms:play-services-location:11.8.0
cordova.system.library.2=com.android.support:support-v4:23+
cordova.system.library.3=com.android.support:support-v13:26.+
cordova.system.library.4=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.5=com.google.firebase:firebase-messaging:11.8.0
cordova.gradle.include.2=phonegap-plugin-push/pushbase-push.gradle

Its work for me