Asthme
Asthme

Reputation: 5353

getting error when importing project in android studio?

Recently i updated my android studio to 0 .30 I was trying to import project in android studion.

Project is using an old version of the Android Gradle plug-in. The minimum supported version is 0.6.1.

Please update the version of the dependency 'com.android.tools.build:gradle' in your build.gradle files.

Consult IDE log for more details (Help | Show Log)

2nd error

You are using an old, unsupported version of Gradle. Please use version 1.8 or greater. Please point to a supported Gradle version in the project's Gradle settings or in
the project's Gradle wrapper (if applicable.) Consult IDE log for more details (Help | Show Log

3rd error

Could not execute build using Gradle distribution ' http://services.gradle.org/distributions/gradle-1.6-bin.zip'. Build file 'C:\Users\Asthme\crushersblue1\babies\build.gradle' line: 8

Could not find method classpath() for arguments
[com.android.tools.build:gradle:0.6.+] on project ':crushersblue1:babies'.

Consult IDE log for more details (Help | Show Log)

Upvotes: 9

Views: 15094

Answers (5)

SamWise
SamWise

Reputation: 697

I was able to fix this by using the file path to my gradle directory:

C:\Users\xxxx.gradle\wrapper\dists\gradle-1.12-all\2apkk7d25miauqf1pdjp1bm0uo\gradle-1.12

the import continued fine.

Upvotes: 5

Binoy Babu
Binoy Babu

Reputation: 17139

This is duplicate of Unable to import Eclipse project to Android Studio (when using default gradle wrapper)

Answer:

I had to edit the gradle wrapper settings in gradle/wrapper/gradle-wrapper.properties and change gradle version to 1.8.

./gradle/wrapper/gradle-wrapper.properties :

#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip

I had to change gradle-1.6-bin.zip to gradle-1.8-bin.zip. I guess the old ADT plugin from eclipse which generates this file still uses the old URL.

Upvotes: 2

RoundSparrow hilltx
RoundSparrow hilltx

Reputation: 799

If all the other solutions here do not work (they are all from 3 days ago)... I found...

I had secondary project in my settings.gradle and each of those projects had their own build.gradle. The Android Studio IDE says that you need to uddate to 0.6.1 but it points to only the first-project build.gradle - I had to manually locate the secondary build.gradle file for those projects and make sure all said 0.6.+ instead of previous versions.

Upvotes: 1

Adam Johns
Adam Johns

Reputation: 36373

Change gradle to 0.6.+ as ling has suggested, and also in your gradle-wrapper.properties file, change the distributionUrl to http\://services.gradle.org/distributions/gradle-1.8-bin.zip.

Upvotes: 0

Linga
Linga

Reputation: 10573

Step 1: Change line in build.gradle from:

dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}

Step 2:

In the YourProject.iml file, delete the entire component name="FacetManager" tag.

Step 3

(Maybe not necessary): In the Android SDK manager, install (if not already installed) Android Support Repository under Extras.

Refer this

Upvotes: 6

Related Questions