Eclipseで作ったプロジェクトをプラグインなしでAndroidStudioにインポートする方法

ネット上にあるサンプルコードとか
Eclipseで作られたものがほとんどです。

で、AndroidStudioで使おうとすると、
Eclipse上でそれ用のプラグインがあります。

これを使ってまずエクスポートします。

Export from Eclipse

1. Update your Eclipse ADT Plugin (you must have version 22.0 or higher).
2. In Eclipse, select File > Export.
3. In the window that appears, open Android and select Generate Gradle build files.
4. Select the project you want to export for Android Studio and click Finish.
5. Your selected project remains in the same location but now contains a build.gradle file and is ready for Android Studio.

で、その後、AndroidStudioを起動して
そのディレクトリに対してインポートします。

Import into Android Studio

1. In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.
2. Click Import Project.
3. Locate the project you exported from Eclipse, expand it, select the build.gradle file and click OK.
4. In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)

Migrating from Eclipse | Android Developers Migrating from Eclipse | Android Developers

これって、いちいちEclipseを起動するのめんどくね?

なので、Eclipseのプロジェクトのディレクトリに対して
「Eclipse起動なし」で
AndroidStudioにインポートしてみます。

続きを読む >>