I'm in Android Studio.

I need to add necessary dependencies to my project.

I'm under an authenticated proxy.

My gradle.properties configuration in my project looks like this:

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

But when I start to sync it returns me 403 Forbidden error when downloading the dependency, specifically this:

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

I'm not pasting the entire error because this is the most important part

Now, if I take the dependency URL (the .pom or the .jar file) and paste it in the browser (firefox, chrome) then it returns me the file correctly.

Of course, the browser is under the same authenticated proxy too.

So, no problems with the browser but Android Studio fails in retrieving the same file.

My sysAdmin is willing to help me but he needs to understand what to do exactly, where does the problem come from.

For security reasons, getting rid of the proxy is not an option.

I really would appreciate help because I can't work if project doesn't sync.

Thanks in advance

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐