What is gradle sync in Android Studio?

What is it? And what does it do?

Gradle sync is a gradle task that looks through all of your dependencies listed in your build.gradle files and tries to download the specified version.

Why does it needs internet connection? What ports does it use?

It requires an internet connection because it is usually downloading these dependencies from a remote location. You can define what ports it uses by changing your gradle.properties. (see below)

I'm working on an enterprise that has a proxy, and it fails trying to connect to somewhere.

Your work proxy may be blocking this and you'll need to add your proxy configuration to solve your issues.

Go into:

and update your proxy configuration url to your work proxy. (automatic or manual depending on your setup).

NOTE: If you are using the command line to run your gradle build, you will probably need to update the proxy settings via your gradle.properties file.

Global Properties File Location : ~/.gradle/gradle.properties (or use your local project file if you have one)

Add proxy settings to this file:

HTTPS

HTTP


If you absolutely cannot get an internet connection via gradle you'll need to download the dependencies another way and reference them locally on your computer or local network.

 

https://stackoverflow.com/questions/43636707/what-is-gradle-sync-in-android-studio?answertab=votes#tab-top

转载于:https://www.cnblogs.com/feng9exe/p/9228466.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值