2

I have a problem moving Android projects from Eclipse to Android Studio

Eclipse : 4.2.2
ADT : 22.3
Android SDK Manager : I have all the items under "Tools" installed (from rev 17 to 22.3)
Android Studio : 0.3.2
I have an automatic gradle installation in C:\Users\r0dy.gradle (where wrapper/dists shows a 1.6 and a 1.8)
I also downloaded manually a gradle 1.9 dist.

I export my project using "Generate gradle build files", runs OK.

In Android Studio, if I import with default settings, it says :
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.)

If I select "Use customizable gradle wrapper" I get :
Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'. Task 'wrapper' not found in root project 'CameraLibrary'.

If I select "Use local gradle distribution" and set "Gradle Home" to my dist path, I get :
Gradle version 1.6 is required. Current version is 1.9 Build file 'D:\workspaces\popfax\CameraLibrary\build.gradle' line: 9

I can't find a way to force Eclipse export to use my 1.9 dist or any other, and after hours of trying, I couldn't find a solution.

Anyone has an idea ?

r0dy
  • 37
  • 2
  • 5
  • possible duplicate of [Unable to import Eclipse project to Android Studio](http://stackoverflow.com/questions/19485981/unable-to-import-eclipse-project-to-android-studio) – quinestor Feb 17 '14 at 13:45

1 Answers1

5

Modify the relevant line in gradle/wrapper/gradle-wrapper.properties to read:

distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip

and import your project using default settings.

Scott Barta
  • 79,344
  • 24
  • 180
  • 163
  • Thanks, it seems to be going in the right direction. I still get an error message though : 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. I edited the build.gradle file : com.android.tools.build:gradle:0.6.1 It worked. Thanks ! – r0dy Nov 27 '13 at 16:42