Daniel Bo
Daniel Bo

Reputation: 2518

Migration from Eclipse to Android Studio

So, as it seems that more and more people are using Android Studio i got curious and wanted to take a peek at it.

I have used Eclipse up until now and wanted to migrate a project to Android Studio. So i exported a gradle buildfile from within Eclipse, as android.developer.com suggested.

That worked fine, now i wanted to import that into Android Studio 0.3.2

When trying to import i got that Unable to import Eclipse project to Android Studio error. Now it is building.

But it got a new suprise, now before it is finished building, its asking specifically for an older Version of Gradle(1.6)... Ok, i can do that. Which leads me right back to the first error. So i tried this - Gradle version 1.6 is required. Current version is 1.8-20130730220035+0000

I can however create a New Project with Android Studio.

I've tried this for about an hour now and im getting sort of pissed, because it doesnt seem to know what it wants. Is it some sort of Bug or did i make some sort of mistake.

Upvotes: 0

Views: 261

Answers (2)

sergej shafarenka
sergej shafarenka

Reputation: 20416

I've just migrated my projects. Here is two suggestions from my side.

  1. Take the latest Android Studio.
  2. Do not export / import projects from Eclipse. Most likely you are going to have errors in the project after this step. Starting from a clean project, which builds, will safe you a lot of time and avoid unnecessary frustration.
  3. Create an empty Android Project in Android Studio. It must build without errors (⌘ F9). The start to enhance it using official Gradle Plugin user guide.
  4. Create libraries folder and add all libraries in there one by one. Update build.gradle dependencies as mentioned in user guide. Make sure everything builds successfully.
  5. After all libraries build you can copy-paste sources, resources and assets from Eclipse project to corresponding folders of Android Studio project. Make sure everything build as expected.
  6. Now you can start with more advanced configuration like ProGuard configuration, release certificates etc.

I've done it in a couple of hours. Hope this helps you too.

Upvotes: 0

Scott Barta
Scott Barta

Reputation: 80010

You're using a very old version of Android Studio. I'd recommend upgrading to 0.4.3. Versions later than 0.4.0 allow direct import of Eclipse projects instead of requiring you to do the cumbersome (and as you've seen problematic) export of projects from Eclipse; it's smarter about setting up the right plugin and Gradle versions. 0.4.3 has some important bugfixes over 0.4.0-0.4.2.

Upvotes: 1

Related Questions