Android Studio Gradle代理设置 [英] Android Studio Gradle proxy settings

查看:676
本文介绍了Android Studio Gradle代理设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译项目时出错:

错误:配置项目':app'时出现问题。

Error:A problem occurred configuring project ':app'.


无法解析配置':app:_debugCompile'的所有依赖项。
无法解析de.hdodenhof:circleimageview:1.2.1。
需要:
MyApp:app:unspecified
无法获取' https://jcenter.bintray.com/de/hdodenhof/circleimageview/1.2.1/circleimageview-1.2.1.pom '。收到状态码407来自服务器:authenticationrequired

Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not resolve de.hdodenhof:circleimageview:1.2.1. Required by: MyApp:app:unspecified Could not GET 'https://jcenter.bintray.com/de/hdodenhof/circleimageview/1.2.1/circleimageview-1.2.1.pom'. Received status code 407 from server: authenticationrequired

我设置代理设置

-Dhttp.proxyHost=proxy.domain.company.com -Dhttp.proxyPort=8090 -Dhttp.proxyUser=atiris -Dhttp.proxyPassword=mysecretpassword

但它没有帮助。此外,我设置 http代理设置 i Android Studio.Any帮助将不胜感激。

But it didn't helped. Also I set http proxy settings i Android Studio.Any help would be greatly appreciated.

推荐答案

如果要使用特定项目的代理,请转到项目目录并找到 gradle.properties 文件。它应与 build.gradle 文件位于同一目录中。如果您没有看到,请创建一个。确保创建 gradle.properties 而不是 gradle.properties.txt

If you want to use a proxy for a particular project, go to your project directory and locate "gradle.properties" file. It should be in the same directory as "build.gradle" file. If you don’t see one, create one. Make sure to create "gradle.properties" and not "gradle.properties.txt".

添加您的代理信息 -

Add your proxy info-


systemProp.http.proxyHost = some-proxy-host.com

systemProp.http.proxyHost=some-proxy-host.com

systemProp.http.proxyPort = some-port

systemProp.http.proxyPort=some-port

systemProp.https.proxyHost = some-proxy-host.com

systemProp.https.proxyHost=some-proxy-host.com

systemProp.https.proxyPort = some-port

systemProp.https.proxyPort= some-port

如果您还有身份验证,请添加 -

If you have authentication as well, add-


systemProp.http.proxyUser = userid

systemProp.http.proxyUser=userid

systemProp.http.proxyPassword = password

systemProp.http.proxyPassword=password

systemProp.https.proxyUser = userid

systemProp.https.proxyUser=userid

systemProp.https.proxyPassword = password

systemProp.https.proxyPassword=password

如果您希望所有项目具有相同的代理设置 -

If you want all projects to have the same proxy setting-

转到您的用户主目录。在Win 7中,它将是 C:\ Users \ username 。找到 .gradle 目录,然后在 .gradle 目录中删除您在上面创建的 gradle.properties 文件。

Go to your user home directory. In Win 7, it would be "C:\Users\username". Locate .gradle directory and drop "gradle.properties" file you created above in .gradle directory.

这篇关于Android Studio Gradle代理设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆