Search code examples
androidcordovagoogle-play-servicesvisual-studio-cordova

Cordova: Cannot compile code - couldn't find any version that matches google play services


I am using the latest version of Visual Studio 2017 and Cordova 6.3.1 to compile cordova project using google play services. It was compiling just fine a few days ago, but now it throws errors:

1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception.
1>MSBUILD : cordova-build error : * What went wrong:
1>MSBUILD : cordova-build error : A problem occurred configuring root project 'android'.
1>MSBUILD : cordova-build error : > Could not resolve all dependencies for configuration ':_armv7DebugCompile'.
1>MSBUILD : cordova-build error :  > Could not find any version that matches com.google.android.gms:play-services-maps:+.
1>MSBUILD : cordova-build error :  Searched in the following locations:
1>MSBUILD : cordova-build error :  https://repo1.maven.org/maven2/com/google/android/gms/play-services-maps/maven-metadata.xml
1>MSBUILD : cordova-build error :  https://repo1.maven.org/maven2/com/google/android/gms/play-services-maps/
1>MSBUILD : cordova-build error :  https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/google/android/gms/play-services-maps/maven-metadata.xml
1>MSBUILD : cordova-build error :  https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/google/android/gms/play-services-maps/
1>MSBUILD : cordova-build error :  file:/C:/ProgramData/Microsoft/AndroidSDK/25/extras/android/m2repository/com/google/android/gms/play-services-maps/maven-metadata.xml
1>MSBUILD : cordova-build error :  file:/C:/ProgramData/Microsoft/AndroidSDK/25/extras/android/m2repository/com/google/android/gms/play-services-maps/
1>MSBUILD : cordova-build error :  Required by:
1>MSBUILD : cordova-build error :  :android:unspecified

and same for different Google Play Services.

I've already tried to reinstall Android Support Repository, Google Play services and Google Repository from Android SDK Manager with no success.

Can anyone help me in this situation? Thanks in advance.


Solution

  • After various attempts I found out, the https was missing because of autohyperlinking. The correct answer is, as @Gabriele Mariotti said - maven { url "https://maven.google.com" } - the url starts with https.