I've Windows Firewall with Inbound and Outbound rules enabled. In android studio, I'm getting "Connection to the internet denied" error while gradle syncing etc. Already allowed studio.exe to connect in firewall but it's not working. If I disable firewall, it's able to connect. So in order to allow android studio to connect to internet without disabling windows firewall, what program should I add to windows firewall rules?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Fixed it by adding java.exe to Windows firewall inbound and outbound rules(in my case C:\Program Files\Java\jdk1.8.0_112\bin\java.exe) and also studio.exe ( C:\Program Files\Android\Android Studio\bin\studio.exe) to the rules. Then I was able to sync without disabling windows firewall. Hope it helps somebody..
回答2:
If you are trying to connect to internet through a company firewall, then you need to edit your gradle.properties file
systemProp.http.proxyHost=XX.XX.XX.XX
systemProp.https.proxyPort=xxxx