1

I've exported my project as Gradle in Eclipse, but when I import it in Android Studio it throws the following error:

Error:Gradle version 1.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in myProject\gradle\wrapper\gradle-wrapper.properties to gradle-1.10-all.zip.

Please fix the project's Gradle settings. Fix Gradle wrapper and re-import project

Community
  • 1
  • 1
noman404
  • 928
  • 1
  • 8
  • 23
  • That doesn't seems to make sense :/ ,Have you got the latest version of android studio? – edwinj Mar 20 '15 at 16:52
  • possible duplicate? http://stackoverflow.com/questions/24289410/gradle-version-1-10-is-required-current-version-is-2-0 – barbiepylon Mar 20 '15 at 16:53

3 Answers3

3

click on your build.gradle file in project explorer and make changes as

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

ReBuild your project! Hope this helps.

silent_programmer
  • 768
  • 2
  • 8
  • 18
  • Thanks @Atharva it works, but now it shows Error:SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable. – noman404 Mar 20 '15 at 21:12
  • Use the new Android Studio SDK location instead of using the old one. Please let me know if this works. – silent_programmer Mar 21 '15 at 03:42
  • I've used that location, also set the Environment variable ANDROID_HOME but it did not work. – noman404 Mar 21 '15 at 05:19
  • Have you checked your sdk path in local.properties? – silent_programmer Mar 21 '15 at 05:37
  • One thing I can suggest you is to delete the old sdk ( for eclipse ) and reinstall the android studio so that it will by default link to the new SDK which will be installed with Android Studio. Usually it gets refer to the old version of sdk as you have imported it from eclipse. Hope this helps! Just wanted to make sure what is your JDK version? – silent_programmer Mar 21 '15 at 05:54
  • JDK 1.7 and i've installed new SDK, but it's not working also. – noman404 Mar 21 '15 at 06:02
  • File -> Project Structure -> SDK Location Check location here! – silent_programmer Mar 21 '15 at 06:05
  • i've checked that location, and that is a valid SDK location. – noman404 Mar 21 '15 at 06:12
  • The only thing I can suggest you now is to create a new project and copy the local.properties file to the imported project. Let me know if this works for you. – silent_programmer Mar 21 '15 at 06:18
  • Chekc your "compileSdkVersion" & "buildToolsVersion", you can check this from build.gradle - > android block!! If it shows you 21 make sure to start the SDK and install the same version of SDK i.e. 21 instead of 19 ( I am assuming this ). HOPE THIS WILL HELP! – silent_programmer Mar 21 '15 at 06:28
  • Checked that, 22~19 all are installed (( – noman404 Mar 21 '15 at 06:37
  • Got new ERROR- "Error:(5, 0) Gradle DSL method not found: 'classpath()' Possible causes:The project 'myProject' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file. The build file may be missing a Gradle plugin. Apply Gradle plugin " – noman404 Mar 21 '15 at 06:38
  • [Here is my build.gradle preview](https://docs.google.com/file/d/0B7ooGN2c7qYkQlpTS2ZGellBc3c/edit?pli=1) oh, it's generated by the eclipse. – noman404 Mar 21 '15 at 06:46
  • What is your android studio and gradle version? – silent_programmer Mar 21 '15 at 06:47
  • android { compileSdkVersion 'Google Inc.:Google APIs:21' buildToolsVersion "21.1.2" Make these changes and I think you need to change the gradle version too. Can you tell me your android studio version? – silent_programmer Mar 21 '15 at 06:51
  • Gradle version 2.2.1 android studio 1.1.0 – noman404 Mar 21 '15 at 06:51
  • Something is really messed up here. Your build.gradle preview shows gradle version 1.1.0 – silent_programmer Mar 21 '15 at 06:54
  • Ok! Go to build.gradle and change classpath to 'com.android.tools.build:gradle:1.1.2' and rebuild your project. – silent_programmer Mar 21 '15 at 06:56
  • that i changed from your solution – noman404 Mar 21 '15 at 06:57
  • Because you android studio version is 1.1.0 you need to change classpath to 'com.android.tools.build:gradle:1.1.2' and rebuild your project! I think this will work for you. – silent_programmer Mar 21 '15 at 06:59
  • i've already did that. But same "Error:(5, 0) Gradle DSL method not found: 'classpath()' Possible causes:The project 'myProject' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file. The build file may be missing a Gradle plugin. Apply Gradle plugin " – noman404 Mar 21 '15 at 07:00
  • Ohh man!! I think someone else would like to help you with this. If I get something for this I will get back to you. – silent_programmer Mar 21 '15 at 07:07
2

Well, after did some research i solved my problem, just clean and Rebuild!!!!

noman404
  • 928
  • 1
  • 8
  • 23
0

when you import that time select appropriate download gradle version

or

you can give path of gradle in your machine.

Please check this out might this is help you. configuring-gradle

For Import project from eclipse to Android Studio check this out. Migrating to Android Studio

I hope this is help you.

Bhagirathsinh Gohil
  • 673
  • 1
  • 9
  • 25