关闭

导出和导入Gradle工程

17569人阅读 评论(1) 收藏 举报
分类:

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


  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.

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


  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.)

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.

1
2

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:3148537次
    • 积分:26436
    • 等级:
    • 排名:第218名
    • 原创:474篇
    • 转载:398篇
    • 译文:0篇
    • 评论:255条
    招聘信息
    公司招聘Java服务器开发(2年以上),Web前端开发(1年以上),有兴趣的可以给我发邮件我会及时和您沟通的(wangjia@wqdata.net)。
    技术交流