【问题标题】:Cordova 5.1.1 build failingCordova 5.1.1 构建失败
【发布时间】:2015-08-31 17:46:25
【问题描述】:

我使用Visual Studio 2015 创建了一个Cordova 5.1.1 项目。我在 ntlm 代理后面。我在我能找到的任何地方(Gradle、Java 控制台、Cro​​dova CLI 等)添加了代理设置,并使用Cntlm 代替NPM,但我仍然无法让构建工作。在 Cordova 5 之前,我使用 Ant 进行了多个构建。

构建失败并出现以下错误:

  FAILURE: Build failed with an exception.
1>
1>  * What went wrong:
1>  A problem occurred configuring root project 'android'.
1>  > Could not resolve all dependencies for configuration ':classpath'.
1>     > Could not resolve com.android.tools.build:gradle:1.0.0+.
1>       Required by:
1>           :android:unspecified
1>        > Failed to list versions for com.android.tools.build:gradle.
1>           > Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
1>              > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
1>                 > peer not authenticated
1>
1>  * Try:
1>  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1>
1>  BUILD FAILED
1>
1>  Total time: 2.389 secs
1>
1>  platforms\android\cordova\node_modules\q\q.js:126
1>                      throw e;
1>                            ^
1>  Error code 1 for command: cmd with args: /s /c ""platforms\android\gradlew" cdvBuildDebug -b "platforms\android\build.gradle" -Dorg.gradle.daemon=true"
1>  Command finished with error code 1: cmd /s /c ""platforms\android\cordova\build.bat" --debug "--buildConfig=\build.json""
1>ERROR building one of the platforms : error : cmd: Command failed with exit code 1
1>  You may not have the required environment or OS to build this project
1>MDAVSCLI : error : cmd: Command failed with exit code 1
1>
1>Build FAILED.

注意:我已经删除了完整路径,但它们在原始构建输出中。

我注意到Maven repo 证书当前无效,但我不知道这是否相关或只是我们的代理未通过证书的一些问题。

【问题讨论】:

    标签: android maven visual-studio-cordova


    【解决方案1】:

    完全按照此处的建议进行操作: http://www.scriptscoop.com/t/82d4495f9d81/android-gradle-cant-connect-to-maven-repo-through-corporate-proxy-need-to-conf.html

    不要忘记你应该设置一个常规的 http 和 https 代理。

    这对我有用,与您遇到的错误完全相同。

    【讨论】:

    • 很遗憾你没有复制和粘贴所写的内容。我无法访问那个网站。
    • 这是一个参考,所以我不能指望它有一天会不可用。检查这个解决方案,我记得,它是我的解决方案:gradle.properties
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-22
    相关资源
    最近更新 更多