Reputation: 2792
What I have:
What I have done
I have been developing with Eclipse for a long time and now I wanted to give a chance to Android Studio so I checked on google developers webpage and I downloaded and updated Android Studio to 0.2.8. As google says, I do need to export from eclipse creating the gradle file so I did it. After that, I opened Android studio and check what it says on google page: "Use gradle wrapper". Every time I try to import my project I get an error saying:
Could not execute build using Gradle distribution 'http://services.gradle.org/distributions-snapshots/gradle-1.8-20130830160653+0000-bin.zip'. Build file 'C:\Users\me\Eclipse\proyectos\myProject\build.gradle' line: 9 A problem occurred evaluating root project 'myProject'. A problem occurred evaluating root project 'myProject'. Gradle version 1.6 is required. Current version is 1.8-20130830160653+0000
What should I do? Everything I have looked on the net is for an update of the ide to 0.2.7 with a project that is imported and not to being imported.
EDIT
gradle file: (my project has a deppendency for which also I made a gradle file from Eclipse. "library" is actionbarSherlock library
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4' } } apply plugin: 'android'
dependencies { compile fileTree(dir: 'libs', include: '*.jar') compile project(':C::Users:me:Eclipse:proyectos:library') }
android { compileSdkVersion 16 buildToolsVersion "18.0.1"
sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } instrumentTest.setRoot('tests') } }
Upvotes: 0
Views: 6089
Reputation: 2792
SOLVED
Finally, after the new upgrades the error has been solved. If you have this error try to update ADT to r22.2.1 and Android Studio to 0.2.9. Then, export again gradle from eclipse and try it to import it from AS.
Maybe you will have now an error with sdk dir importing the file. If so, add the variable ANDROID_HOME to windows variables with the route of your android sdk and after rebotting the computer try it again. Remember that with AS there's a new installation of ADT so you have to update also that one or change the path as shown here https://stackoverflow.com/a/18409923/1200914
Upvotes: 1
Reputation: 3027
You have used Gradle 1.8
, as your error mentions, you should use Gradle 1.6
. Download it from here http://services.gradle.org/distributions-snapshots
Upvotes: 0