Gradle project sync failed. Android Studio

2019-06-10 16:26发布

问题:

I have Android studio 8.6 Gradle plugin 0.12.2 JDK SE Version 7 Update 67

In Android studio, a bar pops up that says "Grade project sync failed." The message box says "Error:Permission denied: connect" I turned the firewall off and I still get the same error.

I have tried everything I can think of. Can anyone help me?

Here is the idea log

https://code.google.com/p/android/issues/attachmentText?id=75520&aid=755200001000&name=idea.log&token=ABZ6GAdMX-o6HMm5QfRzUo_FPCDpZxKGww%3A1409629650650

Here is part of the Gradle daemon log with full log in link.

https://code.google.com/p/android/issues/attachmentText?id=75520&aid=755200002000&name=daemon-5360.out.log&token=ABZ6GAdW5VYzeuv3iYeE7U-HkfF4xTh5dg%3A1409631833795

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'MyApplication'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:0.12.2.
     Required by:
         :MyApplication:unspecified
      > Could not GET 'http://jcenter.bintray.com/com/android/tools/build/gradle/0.12.2/gradle-0.12.2.pom'.
         > Permission denied: connect

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

回答1:

I don't know what happened but now it works.



回答2:

It's seems like some complicated network situation caused that.If it happens again,try set the http proxy in setting.