How set the correct version of play-services in Ionic Pro

1.5k views Asked by At

In the project replacement in the platform / android / projet.properties the following parameters

com.google.android.gms:play-services-maps:+

cordova.system.library.3=com.google.android.gms:play-services-location:+

How do I replace the same in the project or configuration and then charge it to the ionic pro and build it?

2

There are 2 answers

0
Alex On BEST ANSWER

I used the next plugin: cordova-android-play-services-gradle-release

  1. ionic cordova plugin add cordova-android-play-services-gradle-release
  2. ionic cordova platform remove android
  3. ionic cordova platform add [email protected]

this resolve my problem.

0
Turneye On

We had slightly different issue which wasn't solved using cordova-android-play-services-gradle-release.

We were using cordova-plugin-background-geolocation which was adding

com.google.android.gms:play-services-location:11+ 

which was in conflict with phonegap-plugin-push. (I think the difference with OP being -location specified at the end)

Couldn't find a gradle for the play-services-location so the only way to fix was to re-install the plugin with the --GOOGLE_PLAY_SERVICES_VERSION specified, eg...

cordova plugin add cordova-plugin-mauron85-background-geolocation --variable GOOGLE_PLAY_SERVICES_VERSION=11.6.2

Am fairly new to cordova development, but I get the impression that most (all?) plugins allow you to specify this variable and you should use it just as a matter of course to resolve these conflicts before they happen.