6

I recently updated Android Studio to version 0.2, and now when I build my code, I get this error, Please tell me how to overcome this.

Gradle 'NewProject' project refresh failed:

Project is using an old version of the Android Gradle plug-in. The minimum supported version is 0.5.0. Please update the version of the dependency 'com.android.tools.build:gradle' in your build.gradle files. Search in build.gradle files (show balloon)

Renjith
  • 5,783
  • 9
  • 31
  • 42
Vinuthan
  • 1,035
  • 2
  • 12
  • 20

2 Answers2

10

Its a reported issue in Android Studio Build #AI-130.737825, built on July 11, 2013. Luckily, there is a workaround that you can do to fix this import issue.

Externally edit the project's build.gradle file, changing 'com.android.tools.build:gradle:0.4.2' to 'com.android.tools.build:gradle:0.5.+'

Here is the link to the issue

  • 1
    It should be changed to 'com.android.tools.build:gradle:0.5.+' instead of only 0.5.0 – Vinuthan Jul 21 '13 at 12:00
  • The project I am trying to import - https://code.google.com/p/iosched - already has classpath 'com.android.tools.build:gradle:0.5.+'. But I am still getting this error... So I had to change it to 0.6.+. – IgorGanapolsky Dec 05 '13 at 21:18
1

Go to your

build.gradle

file and replace the string

'com.android.tools.build:gradle: (what you have here)'

with

'com.android.tools.build:gradle:0.5'

Alexander Kulyakhtin
  • 47,782
  • 38
  • 107
  • 158
  • Got this Error: Gradle: FAILURE: Could not determine which tasks to execute. * What went wrong: Task 'assemble' not found in root project 'MyProject'. * Try: Run gradle tasks to get a list of available tasks. Could not execute build using Gradle installation '/home/vinuthan/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok/gradle-1.6'. – Vinuthan Jul 15 '13 at 05:43
  • For this error try: "Download the full zip package from http://services.gradle.org/distributions/gradle-1.6-bin.zip manually and copy this zip package to C:\Documents and Settings\vinuthan\gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok\" for Windows, for Mac use ""~/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok/". – g00dy Jul 15 '13 at 06:02
  • But i already have the file in the location you specified, Should i download it again ? – Vinuthan Jul 15 '13 at 06:08
  • @g00dy I did what you suggested, but it didn't work! I am using ActionBarSherlock as a depended project, so I had to update it's build.gradle as well... – Mazen Kasser Jul 15 '13 at 23:18