您的位置:首页 > 编程语言 > Java开发

android工程从Eclipse迁移到Android Studio

2014-09-07 13:09 465 查看
一个优秀的程序员都需要有查阅官方文档的习惯,这是官方的迁移办法。点击

Migrating from Eclipse

If you've previously developed for Android using Eclipse and would like to migrate to Android Studio, you should export your projects from Eclipse in order to generate Gradle build files. You can then import your
project into Android Studio.

Export from Eclipse

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

Import into Android Studio

In Android Studio, close any projects currently open. You should see the
Welcome to Android Studio window.
Click Import Project.
Locate the project you exported from Eclipse, expand it, select the
build.gradle file and click OK.
In the following dialog, leave
Use gradle wrapper
selected and click OK. (You do not need to specify the Gradle home.)
Now that your project is imported to Android Studio, read
Tips and Tricks for some help getting started.

Note: It's possible to import an existing Android project to Android Studio even if you don't generate a Gradle build file from Eclipse—Android Studio will successfully
build and run projects using an existing Ant build file. However, in order to take advantage of build variants and other advanced features in the future, we strongly suggest that you generate a Gradle build file using the ADT plugin or write your own Gradle
build file for use with Android Studio. For more information about the Gradle build system, see the
Gradle Plugin User Guide.


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐