I tried running my App on android studio but I keep getting this error message:
Exception in thread "main" java.net.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
I suspected it could be my internet connectivity or firewall, So I proceeded to download (https://services.gradle.org/distributions/gradle-7.5-all.zip) the Gradle files manually. To my surprise, I couldn’t download the file. I get this error message on the browser:
An error occurred during a connection to objects.githubusercontent.com. PR_CONNECT_RESET_ERROR
Error code: PR_CONNECT_RESET_ERROR
I have checked everywhere to find out whether the site is blocked by my Firewall or Browser but I don’t know where to loook.
How do I get this sorted out? It seems the download location for Gradle is been blocked.
2
Answers
Check in what folder is your Android Studio app, it should automatically download Gradle for you. There is a chance that your folder has read only permission. If you are using Windows make sure your computer is set to Developer Mode, without it your computer will try to stop installations through command line.
Recommendation outside the scope of the problem is to use package managers such as chocolatey or homebrew depending on your system
I experienced the same problem, The solution I used was, I changed my internet connection service provider to different ISP, that I suspected it was my ISP blocking me from accessing https://services.gradle.org/distributions/gradle-7.5-all.zip. Afterwards it worked.