Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - Gradle sync project failed

In Android Studio, I simply created a new project, and it says that:

Gradle project sync failed. Basic functionality will not work properly.

I have searched the web and tried everything, but nothing worked. I have v0.4.6 of Android Studio using Gradle 1.11.

The Error Message Is:

FAILURE: Build failed with an exception.  * Where:                     Build file 'C:\Users\Vinnie\AndroidStudioProjects\MyFirstAppProject\MyFirstApp\build.gradle' line: 9  * What went wrong:           A problem occurred evaluating project ':MyFirstApp'. > Gradle version 1.10 is required. Current version is 1.11. If using the gradle wrapper, try editing the distributionUrl in C:\Users\Vinnie\AndroidStudioProjects\MyFirstAppProject\MyFirstApp\gradle\wrapper\gradle-wrapper.properties to gradle-1.10-all.zip  * Try:                       Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.  BUILD FAILED                  Total time: 1 mins 7.011 secs
like image 914
vcapra1 Avatar asked Mar 03 '14 13:03

vcapra1


People also ask

Why is my gradle sync failing?

Bad internet connection: Since Gradle downloads all the missing versions which are required to run your project, it might fail if you don't have a valid internet connection.

How do I sync gradle project?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.

Why is my gradle build failing?

If gradle --version works, but all of your builds fail with the same error, it is possible there is a problem with one of your Gradle build configuration scripts. You can verify the problem is with Gradle scripts by running gradle help which executes configuration scripts, but no Gradle tasks.


1 Answers

The Android plugin 0.8.x doesn't support Gradle 1.11, you need to use 1.10.

You can read the proper error message in the "Gradle Console" tab.

EDIT

You need to change gradle/wrapper/gradle-wrapper.properties file in this way:

distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip 
like image 136
rciovati Avatar answered Sep 16 '22 14:09

rciovati