I'm just starting out with Android Studio and was very frustrated for a while because I couldn't get anything, not even the template project to build. The log kept saying "Gradle sync failed: The first result from the daemon was empty. Most likely the process died immediately after connection. Consult IDE log for more details (Help | Show Log)"
Turns out, the root of the problem is that when the gradle daemon started, it immediately died because my DNS settings prevented java from establishing a loopback connection. Setting -Djava.net.preferIPv4Stack=true fixes the problem and now I can start gradle standalone and run builds with it, but how do I get Android Studio to do that?