Cordova-plugin-googlemaps: Build fails in Android: "version 11.0.1 is needed for the google-services plugin"

Created on 18 Nov 2017  路  4Comments  路  Source: mapsplugin/cordova-plugin-googlemaps

I'm submitting a ... (check one with "x")
[ ] question
[x] any problem or bug report
[ ] feature request

If you choose 'problem or bug report', please select OS: (check one with "x")
[x] Android
[ ] iOS

cordova information: (run $> cordova plugin list)

ionic cordova plugin ls
> cordova plugin ls
code-push 2.0.1-beta "CodePushAcquisition"
com.googlemaps.ios 2.5.0 "Google Maps SDK for iOS"
cordova-plugin-code-push 1.9.8-beta "CodePush"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-console 1.1.0 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-dialogs 1.3.3 "Notification"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-googlemaps 2.1.1 "cordova-plugin-googlemaps"
cordova-plugin-intercom 4.0.0 "Intercom"
cordova-plugin-ionic-webview 1.1.15 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.4-dev "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 2.0.0 "PushPlugin"

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

{
    "name": "xxxxxx",
    "version": "0.0.1",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/animations": "^4.4.5",
        "@angular/common": "4.4.3",
        "@angular/compiler": "4.4.3",
        "@angular/compiler-cli": "4.4.3",
        "@angular/core": "4.4.3",
        "@angular/forms": "4.4.3",
        "@angular/http": "4.4.3",
        "@angular/platform-browser": "4.4.3",
        "@angular/platform-browser-dynamic": "4.4.3",
        "@ionic-native/code-push": "^4.3.2",
        "@ionic-native/core": "^4.3.0",
        "@ionic-native/google-maps": "^4.3.2",
        "@ionic-native/intercom": "^4.3.2",
        "@ionic-native/local-notifications": "^4.3.2",
        "@ionic-native/push": "^4.3.2",
        "@ionic-native/splash-screen": "4.3.0",
        "@ionic-native/status-bar": "4.3.0",
        "@ionic/storage": "^2.0.1",
        "code-push": "^2.0.1-beta",
        "cordova-android": "^6.2.3",
        "cordova-ios": "^4.4.0",
        "cordova-plugin-code-push": "^1.9.8-beta",
        "cordova-plugin-compat": "^1.2.0",
        "cordova-plugin-console": "^1.1.0",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-dialogs": "^1.3.3",
        "cordova-plugin-file": "^4.3.3",
        "cordova-plugin-file-transfer": "^1.6.3",
        "cordova-plugin-googlemaps": "^2.1.1",
        "cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git",
        "cordova-plugin-intercom": "^4.0.0",
        "cordova-plugin-ionic-webview": "^1.1.15",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "git+https://github.com/apache/cordova-plugin-statusbar.git",
        "cordova-plugin-whitelist": "^1.3.1",
        "cordova-plugin-zip": "^3.1.0",
        "cordova-sqlite-storage": "^2.0.4",
        "ionic-angular": "3.7.1",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "phonegap-plugin-push": "^2.0.0",
        "rxjs": "5.4.3",
        "sw-toolbox": "3.6.0",
        "web-animations-js": "^2.3.1",
        "zone.js": "0.8.18"
    },
    "devDependencies": {
        "@ionic/app-scripts": "3.0.0",
        "typescript": "2.3.4"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-device": {},
            "cordova-plugin-ionic-webview": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "cordova-sqlite-storage": {},
            "phonegap-plugin-push": {
                "SENDER_ID": "xxxxxxxxxxxxxx"
            },
            "cordova-plugin-console": {},
            "cordova-plugin-intercom": {},
            "cordova-plugin-code-push": {},
            "cordova-plugin-googlemaps": {
                "API_KEY_FOR_ANDROID": "XXXXXXXXXXXXXXXXXXXXXXX",
                "API_KEY_FOR_IOS": "XXXXXXXXXXXXXXXXXXXXXXX",
                "LOCATION_WHEN_IN_USE_DESCRIPTION": "Show your location on the map",
                "LOCATION_ALWAYS_USAGE_DESCRIPTION": "Trace your location on the map"
            }
        },
        "platforms": [
            "android",
            "ios"
        ]
    }
}

Current behavior:

Run ionic cordova run android, build fails with this message:

:processDebugGoogleServices

Found com.google.android.gms:play-services-maps:+, but version 11.0.1 is needed for the google-services plugin.
Found com.google.android.gms:play-services-location:+, but version 11.0.1 is needed for the google-services plugin.
:processDebugGoogleServices FAILED

FAILURE: Build failed with an exception.

Most helpful comment

One of plugins you installed specifies the version of Google play services.

Open the platform/Android/project.properties file, and you need to modify com.google.android.gms:play-services:+ to com.google.android.gms:play-services:11.0.1

All 4 comments

One of plugins you installed specifies the version of Google play services.

Open the platform/Android/project.properties file, and you need to modify com.google.android.gms:play-services:+ to com.google.android.gms:play-services:11.0.1

Thanks for the tip!
Yes, phonegap-push-plugin specifies version 11.0.1.
If I change it on project.priperties, it gets overwritten when I run ionic cordova run android.
Is there another way to override a plugin dependency?

Download the phonegap-push-plugin code from thier github, and modify the config.xml.

phonegap-push-plugin offers a parameter to change the version, but compilation fails if you pass + as a value.
There are a bunch of plugins that use google services and since there is no consensus on which version to use, the plugin users are having problems.
The ideal scenario is to get to that consensus. One alternative meanwhile is that every plugin developer adopts the strategy used by phonegap-push-plugin devs (receiving the version as a parameter).
Of course we all could clone the plugin and modify it, but as you know, that has many disadvantages.
This issue is being discussed in the phonegap-push-plugin project and other plugin developers are commenting on it.
Thanks for your help. It's really appreciated!

Was this page helpful?
0 / 5 - 0 ratings