I have already created one project and gradle sync worked successfully.
When I try to create another project it fails and gives the error message that
please change the gradle build tools version first. You need to update the build tools version. Still not working, create a new project and check the gradle file details. 1.5.0 is the latest version I have installed.
classpath 'com.android.tools.build:gradle:1.5.0'
May be sometimes your app use Crashlytic bundle in your graddle And your network cannot resolve Crashlytic library. In another way, may be others lib can cause problem. Please check your internet can access and grep those libs.
So it return an error that
"Error:Cause: peer not authenticated."
For me, I solve this problem by comment code that evolved crashlytics lib all and compile again ---> this problem drain my working time to 4 hrs to know and clear it.
T ^ T
Wish all of us safe from this problem.
After meddling with it, and following Schizo's answer (you should follow it also), and it not working. I realized Android Studio was using java-7-openjdk but I added a certificate to java-8-openjdk, so it didn't work until I changed it to the openJDK 8 in Project Structure, so be sure that you check that also, in case it's not working for you.
There is one more small change can help you in
gradle-wrapper.properties
Change
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
To
distributionUrl=https://services.gradle.org/distributions/gradle-2.4-all.zip
Sync the project once you did the change
In my case I had to download the latest Java SDK and then change the JDK location in the project to the downloaded JDK. Apparently something was wrong with the current JDK (had some warning from my virus scanner about this)
Update your gradle to the latest version . It works perfectly .
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
I hope it helps.