我是cordova的新手,我正在尝试创建一个hello world应用程序。我在构建项目时遇到了一些错误
ANDROID_HOME=C:\Users\rr191602\AppData\Local\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_74
Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip
Exception in thread "main" java.lang.RuntimeException: java.net.ProtocolExceptio
n: Server redirected too many times (20)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.net.ProtocolException: Server redirected too many times (20)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLCo
nnection.java:1848)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1441)
at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
at org.gradle.wrapper.Download.download(Download.java:45)
at org.gradle.wrapper.Install$1.call(Install.java:60)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:65)
... 3 more
ERROR building one of the platforms: Error code 1 for command: cmd with args: /s
,/c,"C:\Users\rr191602\hello\platforms\android\gradlew cdvBuildDebug -b C:\Users
\rr191602\hello\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroi
d.useDeprecatedNdk=true"
You may not have the required environment or OS to build this project
Error: Error code 1 for command: cmd with args: /s,/c,"C:\Users\rr191602\hello\p
latforms\android\gradlew cdvBuildDebug -b C:\Users\rr191602\hello\platforms\andr
oid\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
任何人都可以指导我这个错误
答案 0 :(得分:-1)
删除C:\ Users(用户名).gradle
下的.gradle文件夹然后重新构建项目!它会起作用!