gpt4 book ai didi

android - Gradle错误:服务器返回HTTP响应代码:403的URL:http://services.gradle.org/distributions/gradle-2.2.1-all.zip

转载 作者:行者123 更新时间:2023-12-03 05:18:44 33 4
gpt4 key购买 nike

我目前正在构建的应用程序中出现此错误:

C:\mobile\xtern_mobile\ST>cordova run android
ANDROID_HOME=C:\Users\myPC\AppData\Local\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_66
Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip

Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 403 for URL: http://services.gradle.org/distributions/gradle-2.2.1-all.zip
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.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.io.IOException: Server returned HTTP response code: 403 for URL: http://services.gradle.org/distributions/gradle-2.2.1-all.zip
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.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(ExclusiveFileAccessManager.java:65)
... 3 more
CordovaError: Promise rejected with non-error: Error code 1 for command: cmd with args: /s,/c,"C:\mobile\xtern_mobile\ST\platforms\android\gradlew cdvBuildDebug -b C:\mobile\xtern_mobile\ST\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
at C:\Users\myPC\AppData\Roaming\npm\node_modules\cordova\bin\cordova:30:15
at processTicksAndRejections (internal/process/task_queues.js:93:5)
老实说,我已经尝试了以下建议:
How to Setup gradle-2.2.1-all.zip Manually
但同样的错误不断出现。
我还有其他需要做的事情吗?真的需要一些帮助。
非常感谢!

最佳答案

只需将http://services.gradle.org/distributions/gradle-2.2.1-all.zip替换为https://services.gradle.org/distributions/gradle-2.2.1-all.zip问题是您使用http而不是https。您可以在浏览器中检查它,并且带有https的链接将开始下载文件,而带有http的链接将返回403错误

关于android - Gradle错误:服务器返回HTTP响应代码:403的URL:http://services.gradle.org/distributions/gradle-2.2.1-all.zip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64724223/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com