When I try cordova build android, I’m getting below gradle error, can anyone help

platforms\android\app\build.gradle’ line: 111

  • What went wrong:
    A problem occurred evaluating project ‘:app’.

Could not resolve all files for configuration ‘classpath’.
Could not find any matches for com.android.tools.build:gradle:+ as no versions of com.android.tools.build:gradle are available.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml
https://jcenter.bintray.com/com/android/tools/build/gradle/
file:/C:/Users/MIT/.m2/repository/com/android/tools/build/gradle/maven-metadata.xml
file:/C:/Users/MIT/.m2/repository/com/android/tools/build/gradle/
Required by:
unspecified:unspecified:unspecified


line 111 => apply from: "…/cordova-plugin-fcm-with-dependecy-updated

Same problem with my build. If you find any solution please post it here.

I found solution for my project, and maybe it will be helpful for yours. In my case the problem was in 2 plugins: fcm and push.

Go to platforms->android->build.gradle, and add to your repositories:

maven {
url “https://maven.google.com
}

then, see your ‘classpath ‘com.android.tools.build:gradle:2.2.3’’, and copy 2.2.3, then go to fcm and push plugins located at platform->android
change from:
classpath ‘com.android.tools.build:gradle:+’
to:
'classpath ‘com.android.tools.build:gradle:2.2.3’

for both plugins.

That worked for me, because for some reasone it works only with defined version without +.

1 Like