Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Gradle Error - Protocol Family Unavailable

So I am relatively new to Android dev. and have been getting Android Studio set up on my computers. I have it set up just fine on my Mac. When I downloaded and installed it on my Windows 8.1 desktop the gradle build seems to fail every time. With an error message stating that the Protocol Family Unavailable. I've tried several things including uninstalling and reinstalling Android Studio.

NOTE: I did try what was said to work here Gradle project refresh failed - Protocol family unavailable yet it did not solve the problem for me.

like image 906
Kerbstomp Avatar asked Mar 28 '15 23:03

Kerbstomp


2 Answers

When i use Stunnel i faced this problem and my problem was solved when i disconnent it.

Check that if you having any Stunnel, Vpn or Proxy connection and if you have, disconnect it.

like image 118
sam Avatar answered Sep 20 '22 23:09

sam


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.

like image 37
Francisco Junior Avatar answered Sep 22 '22 23:09

Francisco Junior