1

Gradle build error on the first launch of my android studio.

enter image description here

ADM
  • 16,256
  • 11
  • 37
  • 69
  • is your internet connection working? – karan Apr 18 '20 at 06:50
  • Also please make sure you didn't do some changes in your /etc/hosts file sometimes it can mess up. Make sure that your localhost is pointing to 127.0.0.1 and not to dynamically changing ip address. – Tom Taylor Apr 18 '20 at 14:46

3 Answers3

3

Check your firewall or your network configuration. When I first time launch android studio I facing the same issues, then I realized that the problem is on my firewall configuration. Gradle needs an internet connection to download the dependencies that you specify.

java.net.ConnectException: Connection refused

Community
  • 1
  • 1
Mekel Ilyasa
  • 115
  • 1
  • 3
  • 11
0

Kindly clean your project once and again apply a Gradle build then try to resolve the Error which defined in your screenshot.

Another option is to check your dependencies in the Project structure.

0

It is due to the Firewall configuration that is causing this error , to make sure you can connect VPN to run project as it will run normally.So change your Firewall configuration.

Wahdat Jan
  • 3,563
  • 3
  • 14
  • 37