导出和导入Gradle工程

原创 2013年12月04日 10:08:34

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.

相关文章推荐

Failed to import Gradle project完美解决方案

Failed to import Gradle project 最近装android studio被grable问题折腾得欲仙欲死,差点都回eclipse了。查了网上的N多种方案都没法彻底解决。...

Import Project...出现 Building 'xxxx' Gradle project info会卡半天,完美解决

Import Project...出现 Building 'xxxx' Gradle project info会卡半天 点cancle也不管用,然后会变成这样 直接Cancel变成不可用状态,只能在任...

错误:Failed to import Gradle project

1.错误:Failed to import Gradle project 错误原因:android studio 没能自动下载gradle-3.3-all.zip(版本号无所谓)文件造成的。 Gr...

IntelliJ IDEA如何导入Gradle项目

最近学习Gradle,本文来重点介绍一下,如何使用`IntelliJ IDEA`导入`Gradle项目的一种方法。...

Gradle多项目构建并将项目导入到Eclipse

Gradle多项目构建并将项目导入到Eclipse

从一个多项目Web工程看Eclipse如何导入Gradle项目

概述上一节,我们说了Eclipse如何安装Gradle的插件,以达到对Gradle的支持。这里再次说一下为什么我们需要熟悉Gradle构建工具,主要原因就是很多开源项目现在都在改用Gradle作为构建...

IDEA 及 Gradle 使用总结

前言 今年三月来的深圳,五月份要上渠道包,所以使用上了Android Gradle打包方式,从此与IDEA(Android Studio的前身)结缘,用IDEA也有半年了,解决问题挺也蛮多。 应...
  • cluzax
  • cluzax
  • 2015年06月21日 19:57
  • 28488

Gradle:Gradle版本build.gradle 中的gradle版本与gradle-wrapper.properties不匹配

警告报错如下:Warning:Gradle version 2.8 is required. Current version is 2.4. If using the gradle wrapper...

gradle-wrapper.properties中各属性的含义

gradle-wrapper.properties中各属性的含义1. gradle-wrapper.properties每一个用gradle编译的工程,都会有一个gradle\wrapper目录。该目...

如何从Eclipse迁移到AndroidStudio

参考http://developer.android.com/sdk/installing/studio.html Android Studio与Eclipse的不同点主要有 Gradle-based...
  • FeeLang
  • FeeLang
  • 2014年01月20日 18:04
  • 16087
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:导出和导入Gradle工程
举报原因:
原因补充:

(最多只允许输入30个字)