Basic Block
Basic Block

Reputation: 781

Fresh Cordova build error

I just installed a fresh copy of Cordova on Windows 10 and am trying to build my first Android app (using this guide). It seems like the script couldn't download gradle-2.2.0.pom, I tried the URL and indeed the file isn't there. I am not sure where to go from here :/

c:\test\hello>cordova build android
ANDROID_HOME=C:\Users\Stuffe\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_112
Subproject Path: CordovaLib

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:2.2.0.
     Required by:
         :android:unspecified
      > Could not resolve com.android.tools.build:gradle:2.2.0.
         > Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom'.
            > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom'.
               > Connect to repo1.maven.org:443 [repo1.maven.org/127.0.1.2] failed: Connection refused: connect
      > Could not resolve com.android.tools.build:gradle:2.2.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom'.
            >
BUILD FAILED

Total time: 3.134 secs
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom'.
               > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/127.0.1.3] failed: Connection refused: connect

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:2.2.0.
     Required by:
         :android:unspecified
      > Could not resolve com.android.tools.build:gradle:2.2.0.
         > Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom'.
            > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom'.
               > Connect to repo1.maven.org:443 [repo1.maven.org/127.0.1.2] failed: Connection refused: connect
      > Could not resolve com.android.tools.build:gradle:2.2.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom'.
               > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/127.0.1.3] failed: Connection refused: connect

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

Upvotes: 0

Views: 440

Answers (1)

Jeffrey
Jeffrey

Reputation: 4650

Remove the latest version of gradle and install gradle 2.1.4. Now try to build again. It worked for me.

Upvotes: 1

Related Questions