How to migrate a project from Eclipse to Android Studio

English address: http://developer.android.com/sdk/installing/migrate.html

Translation: Android Studio Chinese Team (Sledgehammer Translation)

 

If you have done Android development with Eclipse before, and now want to import the project in Eclipse into the Android Studio environment, the first thing to do is to generate the Build Gradle file. Because Android Studio uses Gradle to manage projects, the specific steps are as follows:

 

Export from Eclipse

 

1. Upgrade your ADT plugin version to above 22.0.

2. In Eclipse, select File-->Export.

3. In the pop-up export window, open the Android folder and select "Generate Gradle Build Files".

4. Select the project you want to import into Android Studio, Finish.

 

PS: The exported project will be in the same directory as the original project. When overwriting the original project, a new file called build.gradle will be added. This file will be read first when importing into Android Studio.

 

Import into Android Studio

 

1. In Android Studio, first close your currently open project.

2. On the welcome interface, click Import Project (Note: You can also directly select Import project in the menu)

3. Select the project you exported in Eclipse, expand the directory, click the build.gradle file, and then OK

4. In the subsequent pop-up dialog box, you will be asked to select the Gradle configuration, and select Use gradle wrapper. (Note: You can also customize the Gradle installed on your machine)

 

PS: If there is no Grade build file, you can also import a normal Android project into Android Studio, it will use the existing Ant build. But in order to better use the later functions and make full use of build variables, it is strongly recommended to first Generate Gradle files from ADT plugin and import into Android Studio

 

From: http://www.android-studio.org/index.php/docs/guide/129-eclipse-to-androidstdio

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326646702&siteId=291194637