Search code examples
cordovacordova-plugins

Could not find any version that matches com.google.android.gms:play-services-gcm:12+


Build Date: 2018-03-29 08:31:50 +0000

PLUGIN OUTPUT

Fetching plugin "cordova-plugin-device@~1.1.6" via npm Installing "cordova-plugin-device" at "1.1.7" for android Fetching plugin "cordova-plugin-dialogs@~1.3.3" via npm Installing "cordova-plugin-dialogs" at "1.3.4" for android Fetching plugin "cordova-plugin-spinnerdialog@~1.3.2" via npm Installing "cordova-plugin-spinnerdialog" at "1.3.2" for android Fetching plugin "cordova-plugin-whitelist@~1.3.2" via npm Installing "cordova-plugin-whitelist" at "1.3.3" for android

           This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Fetching plugin "cordova-plugin-x-toast@~2.6.0" via npm Installing "cordova-plugin-x-toast" at "2.6.2" for android Fetching plugin "phonegap-plugin-push@^1.8.4" via npm Installing "phonegap-plugin-push" at "1.10.7" for android Subproject Path: CordovaLib Fetching plugin "uk.co.workingedge.phonegap.plugin.launchnavigator@^4.1.0" via npm Installing "uk.co.workingedge.phonegap.plugin.launchnavigator" at "4.2.0" for android Fetching plugin "cordova-plugin-actionsheet@2" via npm Installing "cordova-plugin-actionsheet" at "2.3.3" for android Plugin dependency "[email protected]" already fetched, using that version. Dependent plugin "cordova-plugin-dialogs" already installed on android. Subproject Path: CordovaLib Fetching plugin "cordova-plugin-ios-camera-permissions@^1.2.0" via npm Installing "cordova-plugin-ios-camera-permissions" at "1.2.0" for android Fetching plugin "de.appplant.cordova.plugin.local-notification@^0.8.5" via npm Installing "de.appplant.cordova.plugin.local-notification" at "0.8.5" for android Plugin dependency "[email protected]" already fetched, using that version. Dependent plugin "cordova-plugin-device" already installed on android. Fetching plugin "cordova-plugin-app-event" via npm Installing "cordova-plugin-app-event" at "1.2.1" for android Subproject Path: CordovaLib Fetching plugin "cordova-plugin-splashscreen@^5.0.2" via npm

Installing "cordova-plugin-splashscreen" at "5.0.2" for android

COMPILE OUTPUT

Subproject Path: CordovaLib Running command: /project/gradlew cdvBuildDebug -b /project/build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead. at build_2i8nzouqc2wrs6o6f4wz2xu2m.run(/project/build.gradle:138) The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0. Incremental java compilation is an incubating feature. The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead. The ProjectDependency.getProjectConfiguration() method has been deprecated and is scheduled to be removed in Gradle 4.0. ModuleDependency.getConfiguration() has been deprecated and is scheduled to be removed in Gradle 4.0. Use ModuleDependency.getTargetConfiguration() instead. File /.android/repositories.cfg could not be loaded.

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring root project 'project'.

    Could not resolve all dependencies for configuration ':_debugApkCopy'. Could not find any version that matches com.google.android.gms:play-services-gcm:12+. Versions that do not match: 11.0.4 11.0.2 11.0.1 11.0.0 10.2.6 + 18 more Required by: project :

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

BUILD FAILED

Total time: 2.839 secs Command finished with error code 1: /project/gradlew cdvBuildDebug,-b,/project/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true Error: /project/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring root project 'project'.

    Could not resolve all dependencies for configuration ':_debugApkCopy'. Could not find any version that matches com.google.android.gms:play-services-gcm:12+. Versions that do not match: 11.0.4 11.0.2 11.0.1 11.0.0 10.2.6 + 18 more Required by: project :

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. at ChildProcess.whenDone (/project/cordova/node_modules/cordova-common/src/superspawn.js:169:23) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:877:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)


Solution

  • Check here, I had exactly the same issue. Hope it solves your problem.

    If you don't care about the taget API level, you can make cordova platform rm android and then cordova platform add android@5 (this will add the latest cordova-android 5th version (5.1.2 I believe) Otherwise, check the link above. Maybe it's what you need.

    As stated on the first comment I'm updating the answer :-)

    I tried cordova platform add android@5 and afterwards cordova run android and it worked like a charm.

    UPDATE

    The line abov "solved" the issue partially, but my targeted API level was 23 instead of 25. The issue, after almost month and a half of trying different SDK tools/build-tools/Google repo combinations I found the solution.

    Navigate to platforms/android/project.properties and look for a line like cordova.system.library.2=com.google.android.gms:play-services-gcm:12+

    Notice that 12+ at the end. Simply change it to 11+, that will do the job. Hope nobody goes through this like I did.