title: How to fix Android Studio not being able to connect to Gradle daemon?
body: <p>I am trying to start Android Studio and keep getting Gradle errors. Looking at the daemon logs, it seems like the daemon will only accept connections from an IPv6 connection or 127.0.0.1.</p>
  
  <p>However, I don't know how to enable it to accept other connections nor use IPv6. I have tried to add IPv6 flags in various places to no avail.</p>
  
  <p>Note that the code iterates over my network interfaces, but still only accepts 127.0.0.1 connections.</p>
  
  <p>The error itself is from this portion of the Gradle code:</p>
  
  <p><a href="https://code-review.gradle.org/browse/Gradle/subprojects/messaging/src/main/java/org/gradle/messaging/remote/internal/inet/TcpIncomingConnector.java?r=6264564978680860f88e7a43659459f778546fe8#to104" rel="noreferrer">https://code-review.gradle.org/browse/Gradle/subprojects/messaging/src/main/java/org/gradle/messaging/remote/internal/inet/TcpIncomingConnector.java?r=6264564978680860f88e7a43659459f778546fe8#to104</a></p>
  
  <p>Here is the log file:</p>
  
  <pre><code>17:49:57.451 [INFO] [org.gradle.launcher.daemon.server.Daemon] start() called on daemon - DefaultDaemonContext[uid=f2ffb085-b7ad-446a-983d-d6d47a3ae4c0,javaHome=/usr/lib/jvm/java-7-oracle,daemonRegistryDir=/home/whistlepig/.gradle/daemon,pid=7040,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
  17:49:57.466 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] updating lastActivityAt to 1422226197466
  17:49:57.477 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface vboxnet0
  17:49:57.478 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? false
  17:49:57.479 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? true
  17:49:57.481 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /fe80:0:0:0:800:27ff:fe00:0%4
  17:49:57.483 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /192.168.56.1
  17:49:57.487 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote multicast interface vboxnet0
  17:49:57.488 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface p10p1
  17:49:57.489 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? false
  17:49:57.491 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? true
  17:49:57.492 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /169.254.8.98
  17:49:57.493 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote multicast interface p10p1
  17:49:57.494 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface p9p1
  17:49:57.496 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? false
  17:49:57.497 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? true
  17:49:57.499 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /fe80:0:0:0:12c3:7bff:fe46:5caf%2
  17:49:57.500 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /10.0.0.45
  17:49:57.501 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote multicast interface p9p1
  17:49:57.503 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface lo
  17:49:57.504 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? true
  17:49:57.505 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? false
  17:49:57.507 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding loopback address /0:0:0:0:0:0:0:1%1
  17:49:57.508 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding loopback address /127.0.0.1
  17:49:57.515 [DEBUG] [org.gradle.messaging.remote.internal.inet.TcpIncomingConnector] Listening on [73551d2b-fa6b-4f37-8520-8694106b50e7 port:49792, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]].
  17:49:57.521 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Sun Jan 25 17:49:57 EST 2015, with address: [73551d2b-fa6b-4f37-8520-8694106b50e7 port:49792, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]]
  17:49:57.523 [INFO] [org.gradle.launcher.daemon.server.DomainRegistryUpdater] Advertising the daemon address to the clients: [73551d2b-fa6b-4f37-8520-8694106b50e7 port:49792, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]]
  ...
  [org.gradle.messaging.remote.internal.inet.TcpIncomingConnector] Cannot accept connection from remote address /10.0.0.45.
  </code></pre>