Android Studio Gradle Error - Protocol Family Unavailable

I run into this problem when my firewall blocked studio64.exe from connecting to the internet. I fixed it by granting access.


When I used Stunnel I faced this problem and my problem was solved when I disconnented it.

Check too see if you have any Stunnel, Vpn or Proxy connection and if so, disconnect it.


You could try to fix it temporarily by disabling your anti-virus software while using Android Studio. I'm not entirely sure it will work, but it's worth a try, it worked for me, though I'm aware-, and agree with that this is far from a permanent fix, but it might be good enough while waiting for a fix from the Android Studio team, at least it will let you keep working!

Hope this helps!


I also had this problem and the referenced thread also didn't work for me.

What did work was setting _JAVA_OPTIONS environment variable to make Java use IPv4.

_JAVA_OPTIONS = -Djava.net.preferIPv4Stack=true

Note that Android Studio sets this variable in the vmoptions file. But for some reason, it isn't used by the Java VM started by Android Studio to run Gradle daemon.

After I did that, everything started to work ok and Gradle could build my project.

I hope it helps.