How to allow Android Studio to connect to internet via Windows Firewall?

♀尐吖头ヾ 提交于 2019-12-08 06:28:01

问题


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



来源:https://stackoverflow.com/questions/41787197/how-to-allow-android-studio-to-connect-to-internet-via-windows-firewall

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!