android gradle代理
- 作者: 吴晰晰
- 来源: 51数据库
- 2020-09-28
在studio中进入到设置界面,在最上面搜索http,就能看看http协议的代理界面,设置完后,在项目目录里找到gradle.properties文件,打开在里面加上如下代码:
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=58253
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=58253
58253是http代理的端口,如果项目里没有gradle.properties文件,就自己创建一个就可以了,但是也不能随便写的,如果有就把上面的代码放到里面就可以了~~
到android studio安装目录,打开bin目录,编辑idea.properties, 在文件末尾添加:
disable.android.first.run=true
这将禁用第一次运行。
然后打开 android studio, 在settings > http proxy settings设置代理相关参数,关闭android studio.
再次打开idea.properties文件,删除刚刚添加的 disable.android.first.run=true ,并重新打开android studio .
因为已经设置了代理,现在android studio就可以正常启动了。
方法2:
创建或者修改文件: ~/.androidstudio/config/options/other.xml 或者
~/.androidstudiobeta/config/options/other.xml ,该目录根据android studio 版本不同可能有差异.
将127.0.0.1 和3128 修改成你的代理设置。
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=58253
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=58253
58253是http代理的端口,如果项目里没有gradle.properties文件,就自己创建一个就可以了,但是也不能随便写的,如果有就把上面的代码放到里面就可以了~~
到android studio安装目录,打开bin目录,编辑idea.properties, 在文件末尾添加:
disable.android.first.run=true
这将禁用第一次运行。
然后打开 android studio, 在settings > http proxy settings设置代理相关参数,关闭android studio.
再次打开idea.properties文件,删除刚刚添加的 disable.android.first.run=true ,并重新打开android studio .
因为已经设置了代理,现在android studio就可以正常启动了。
方法2:
创建或者修改文件: ~/.androidstudio/config/options/other.xml 或者
~/.androidstudiobeta/config/options/other.xml ,该目录根据android studio 版本不同可能有差异.
将127.0.0.1 和3128 修改成你的代理设置。
推荐阅读
