cordova build android 失败

新手上路,请多包涵

问题描述

cordova build android失败
使用cordova build android命令后 一直在download
download到这一句就失败了

Download https://maven.google.com/com/...

问题出现的环境背景及自己尝试过哪些方法

尝试过改版本号 cordova 换成8.0.0后依然失败

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)

Download https://maven.google.com/com/android/tools/annotations/26.0.0/annotations-26.0.0.jar
Download https://maven.google.com/com/android/tools/external/com-intellij/intellij-core/26.0.0/intellij-core-26.0.0.jar





FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
   > Could not download protobuf-java.jar (com.google.protobuf:protobuf-java:3.0.0)
      > Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.jar'.
         > Could not GET 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.jar'.
            > Operation timed out (Read failed)
   > Could not download ddmlib.jar (com.android.tools.ddms:ddmlib:26.0.0)
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/26.0.0/ddmlib-26.0.0.jar'.
         > Could not GET 'https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/26.0.0/ddmlib-26.0.0.jar'.
            > Remote host closed connection during handshake

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

* Get more help at https://help.gradle.org

BUILD FAILED in 20m 14s
(node:21589) UnhandledPromiseRejectionWarning: Error: /Users/yangbin/code/work/demo2/hello/platforms/android/gradlew: 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 files for configuration ':classpath'.
   > Could not download protobuf-java.jar (com.google.protobuf:protobuf-java:3.0.0)
      > Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.jar'.
         > Could not GET 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.jar'.
            > Operation timed out (Read failed)
   > Could not download ddmlib.jar (com.android.tools.ddms:ddmlib:26.0.0)
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/26.0.0/ddmlib-26.0.0.jar'.
         > Could not GET 'https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/26.0.0/ddmlib-26.0.0.jar'.
            > Remote host closed connection during handshake

* Try:

你期待的结果是什么?实际看到的错误信息又是什么?

阅读 3.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进