chenchao_1983 发表于 2015-8-18 08:35:51

cordova build 出错 在gradle-2.2.1-all.zip 解压后

Running: c:\myapp\platforms\android\gradlew cdvBuildDebug -b c:\myapp\platforms\
android\build.gradle -Dorg.gradle.daemon=true
Unzipping C:\Users\Administrator\.gradle\wrapper\dists\gradle-2.2.1-all\2m8005s6
9iu8v0oiejfej094b\gradle-2.2.1-all.zip to C:\Users\Administrator\.gradle\wrapper
\dists\gradle-2.2.1-all\2m8005s69iu8v0oiejfej094b

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:1.0.0+.
   Required by:
         :android:unspecified
      > Failed to list versions for com.android.tools.build:gradle.
         > Unable to load Maven meta-data from https://repo1.maven.org/maven2/co
m/android/tools/build/gradle/maven-metadata.xml.
            > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/bu
ild/gradle/maven-metadata.xml'.
               > peer not authenticated

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

BUILD FAILED

Total time: 20.736 secs

c:\myapp\platforms\android\cordova\node_modules\q\q.js:126
                  throw e;
                        ^
Error code 1 for command: cmd with args: /s /c "c:\myapp\platforms\android\gradl
ew cdvBuildDebug -b c:\myapp\platforms\android\build.gradle -Dorg.gradle.daemon=
true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1

You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
    at ChildProcess.whenDone (C:\Users\Administrator\AppData\Roaming\npm\node_mo
dules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
    at ChildProcess.emit (events.js:110:17)


在cordova build 下载gradle之后C:\Users\Administrator\.gradle\wrapper
\dists\gradle-2.2.1-all\2m8005s69iu8v0oiejfej094b 解压,我的同事还下载一些东西,我的直接报错,研究好久不知道为什么

paultao 发表于 2015-8-18 12:09:01

gradle 配置一下环境变量;再有看一下是否有代理问题
如果有
需要设置
gradle.propertiespath:C:\test\mytest1\platforms\android


systemProp.http.proxyHost=192.168.1.x
systemProp.http.proxyPort=8090
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost   

systemProp.https.proxyHost=192.168.1.x
systemProp.https.proxyPort=8090
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost

chenchao_1983 发表于 2015-8-18 12:41:02

paultao 发表于 2015-8-18 12:09
gradle 配置一下环境变量;再有看一下是否有代理问题
如果有
需要设置


我同事也没设置这些就好用,先谢谢你了朋友

chenchao_1983 发表于 2015-8-19 08:21:47

顶起来啊,还是没解决,大神帮帮我啊

taoyujie 发表于 2015-9-17 20:35:26

chenchao_1983 发表于 2015-8-19 08:21
顶起来啊,还是没解决,大神帮帮我啊

我现在也遇到了这个问题,你的解决了吗?
页: [1]
查看完整版本: cordova build 出错 在gradle-2.2.1-all.zip 解压后