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

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

问题描述

我在编译项目时出错:

错误:配置项目:app"时出现问题.

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

无法解析配置 ':app:_debugCompile' 的所有依赖项.无法解析 de.hdodenhof:circleimageview:1.2.1.要求:我的应用程序:应用程序:未指定无法获取 'https://jcenter.bintray.com/de/hdodenhof/circleimageview/1.2.1/circleimageview-1.2.1.pom'.从服务器收到状态代码 407:需要身份验证

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.任何帮助将不胜感激.

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".

添加您的代理信息-

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=密码

systemProp.http.proxyPassword=password

systemProp.https.proxyUser=userid

systemProp.https.proxyUser=userid

systemProp.https.proxyPassword=密码

systemProp.https.proxyPassword=password

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

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

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

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天全站免登陆