gpt4 book ai didi

android - 代理下的gradle同步上的Android Studio 403禁止错误

转载 作者:行者123 更新时间:2023-11-30 05:11:05 25 4
gpt4 key购买 nike

我在Android Studio中。
我需要在项目中添加必要的依赖项。
我在经过身份验证的代理下。

我在项目中的gradle.properties配置如下所示:

systemProp.http.proxyHost=my.proxy.host
systemProp.http.proxyPort=3128
systemProp.http.proxyUser=myUser
systemProp.http.proxyPassword=myPassword
systemProp.http.nonProxyHosts=localhost
systemProp.http.auth.ntlm.domain=cha.jovenclub.cu

systemProp.https.proxyHost=my.proxy.host
systemProp.https.proxyPort=3128
systemProp.https.proxyUser=myUser
systemProp.https.proxyPassword=myPassword
systemProp.https.nonProxyHosts=localhost
systemProp.https.auth.ntlm.domain=cha.jovenclub.cu

但是,当我开始同步时,下载依赖项时会返回403 Forbidden错误,具体如下:
Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.jar'.
at org.gradle.internal.resource.ResourceExceptions.failure(ResourceExceptions.java:74)
at org.gradle.internal.resource.ResourceExceptions.getFailed(ResourceExceptions.java:57)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.copyToCache(DefaultCacheAwareExternalResourceAccessor.java:201)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.access$300(DefaultCacheAwareExternalResourceAccessor.java:54)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor$1.create(DefaultCacheAwareExternalResourceAccessor.java:89)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor$1.create(DefaultCacheAwareExternalResourceAccessor.java:81)
at org.gradle.cache.internal.ProducerGuard$AdaptiveProducerGuard.guardByKey(ProducerGuard.java:97)
at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.getResource(DefaultCacheAwareExternalResourceAccessor.java:81)
at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.downloadByCoords(DefaultExternalResourceArtifactResolver.java:133)
at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.downloadStaticResource(DefaultExternalResourceArtifactResolver.java:97)
at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.resolveArtifact(DefaultExternalResourceArtifactResolver.java:66)
at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.resolveArtifact(ExternalResourceResolver.java:477)


Caused by: org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not GET 'https://d29vzk4ow07wi7.cloudfront.net/ab88dab9bd2a3c31c4e6aaa0eb4168d13f126e9076561bb42f5f3fe80c902a78?response-content-disposition=attachment%3Bfilename%3D%22kotlin-gradle-plugin-1.2.71.jar%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvYWI4OGRhYjliZDJhM2MzMWM0ZTZhYWEwZWI0MTY4ZDEzZjEyNmU5MDc2NTYxYmI0MmY1ZjNmZTgwYzkwMmE3OD9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPWF0dGFjaG1lbnQlM0JmaWxlbmFtZSUzRCUyMmtvdGxpbi1ncmFkbGUtcGx1Z2luLTEuMi43MS5qYXIlMjIiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE1NDQ1NjM0Nzd9LCJJcEFkZHJlc3MiOnsiQVdTOlNvdXJjZUlwIjoiMC4wLjAuMC8wIn19fV19&Signature=BDTjM-~StUfVLL-JmPIj4hniCxalejSsb6honjOR45AbXxxdK-u2axgBZ2cNY~sRI7jSoIlgv57tyAIOz3SI-vHYr4rjV9NqAEdU7RxwAFG8L8pGa9qvmYX8x9h6EUTncqGIedJzCwc5MK77PrApKO5eejkDwDiLsn7GQCnVKDagqdLSaa-e9WtZjecOcE89sOeWXlA3Eed907AG2FDIqbmAMVXt8qRDK3r7sKhiMZv3P6l6CG9X3kPuUB6t144BNseBYL1rvyOFJ-F-7JBT0zvP6aCLg6i13FpLnZU4MxX7sSDsFvCoOf2RXA0ottASB~MAxg6tU2R-Dq5nRcvQtQ__&Key-Pair-Id=APKAIFKFWOMXM2UMTSFA'. Received status code 403 from server: Forbidden

我没有粘贴整个错误,因为这是最重要的部分

现在,如果我使用依赖项URL(.pom或.jar文件)并将其粘贴到浏览器(firefox,chrome)中,则它将正确地返回文件。
当然,浏览器也处于相同的身份验证代理下。

因此,浏览器没有问题,但Android Studio检索相同文件失败。

我的sysAdmin愿意为我提供帮助,但他需要了解确切地执行操作,问题从何而来。
出于安全原因,放弃代理不是一个选择。

我非常感谢您的帮助,因为如果项目不同步,我将无法工作。

提前致谢

最佳答案

请按照此处提到的步骤操作。
https://stackoverflow.com/a/43199591/12427927
我有同样的问题。
这有助于解决它。

关于android - 代理下的gradle同步上的Android Studio 403禁止错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53732627/

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