我刚刚在Windows 10上安装了Cordova的新副本,我正在尝试构建我的第一个Android应用程序(使用此guide)。似乎脚本无法下载gradle-2.2.0.pom,我尝试了URL,实际上文件不存在。我不知道从哪里开始:/
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.
答案 0 :(得分:2)
删除最新版本的gradle并安装gradle 2.1.4。现在尝试再次构建。它对我有用。