When you run the ionic cordova command , you can change the version, I have the same error, and I fixed the problem by changing the version of my node modules, my cordova plugin, version from Android studio.
My config below:
ANDROID STUDIO: 3.0.0
pply plugin: 'com.android.application'
buildscript {repositories {jcenter () maven {url " https://maven.google.com "}}
// Switch the Android Gradle plugin version requirement depending on the // installed version of Gradle. This dependency is documented at // http://tools.android.com/tech-docs/new-build-system/version-compatibility // and https://issues.apache.org/jira/browse/CB-8143 dependencies { classpath 'com.android.tools.build:gradle:2.2.3' classpath 'com.google.gms:google-services:3.1.1' // google-services plugin }
}
// Allow plugins to declare Maven dependencies via build-extras.gradle. allprojects {repositories {jcenter () maven {url " https://maven.google.com "}}}
task shell (type: Wrapper) {gradleVersion = '2.14.1'}
... ... ...
... ...
apply plugin: 'com.google.gms.google-services'
Gradle version: 3.3 com.google.android.gms: docking services: 11.4.2
In some cases, the node module and cordova plugin are wrong, so you manually delete them in the folder. Remember to remove and add the cordova plugin when updating it.
Try going to android studio => files => project structure => project => ok Normally, Android studio should sync your gradle
OR
Error: more than one library with package name com.google.android.gms.license
In my case, the problem was that I included:
compile 'com.google.android.gms:play-services-wearable:+' compile 'com.google.android.gms:play-services:4.4.52'
both wearable game services and conventional ones. I commented on the wear resistant part and it works. I'm not sure that I will need it, but it was turned on by the project wizard by default
I hope I can help you. Go on!