0

I'm trying to migrate from using Eclipse for my Android-project to the new Android Studio, and I'm having an issue related to Gradle.

What I want is for me to push the latest Eclipse-build to Github, and then be able to pull it down in Android Studio, having the latter automatically convert the project to a Gradle-build. If I'm reading the documentation right, the Android Studio import is supposedly able to do this.

When importing, I can choose between "Create project from exisiting sources" or "Import project from external model"

If I choose the first option, the project won't use Gradle (as far as I can see). If I choose the second, it seems to be looking for an already existing gradle buildfile "build.gradle" in my project.

So - Should I download a Gradle-plugin to Eclipse and make a gradle build-file there, or am I doing something wrong in the import?

It seems the only other questions I can find on SO is about importing and Eclipse export or simply how to pull a project from Github in Android Studio.

Thanks :-)

jhm
  • 4,379
  • 5
  • 33
  • 49

2 Answers2

0


Importing and converting an existing Eclipse project into a Android Studio Gradle project is quite simple :

File -> Import Project (in Android Studio)
Select the manifest of your Eclipse Android project.

Done.

There may be some dependacy management to deal with.

You can also take a look here :
How do you import an Eclipse project into Android Studio now?

Community
  • 1
  • 1
AdrienG
  • 310
  • 4
  • 9
  • Yes, but that is not going through Github, as I want it to :-) I don't want to have to export from eclipse, import from AS, only then to create a new git repo for the converted project. Thank you for your answer, though :-) – jhm Jan 13 '15 at 15:49
0

How about this:

  • clone repo to location 1
  • export from eclipse
  • import to android studio in location 2
  • copy the .hg files or whatever's applicable from 1 to 2
  • commit from location 2 including deleting eclipse files

Now the repo will have the android studio project and not eclipse.

nasch
  • 5,330
  • 6
  • 31
  • 52