My Android Studio was working fine till morning, but since tonight I get error saying \"Gradle sync failed: Connection timed out: connect. If you are behind an HTTP proxy, p
There are several countries that their IP's are blocked by Android Studio so if you feel your IP is one of them just simply connect to a VPN service.
Invalidate cache & restart the android studio works for me!
I solved it by executing cleanBuildCache in android studio
open Gradle projects tab in the right top corner of android studio under build folder double click on cleanBuildCache and then run you project
I think it's a network issue. My project currently fails to build unless I pass the --offline argument to gradle. I think the S3 outage is impacting repos hosting dependencies.
Try ./gradlew tasks --offline
Or, to make android studio run in offline mode, follow the instructions: https://stackoverflow.com/a/32173577/1043518
This may also happen when you don't have an internet connection on the network you are connected to . the fix would be to easily get a proper internet connection and re-sync Gradle.
It can be a network issue sometimes. You can try to resolve it by turning off your "Firewall Protection". Also you need to turn off Firewall Protection from Antivirus.