从Eclipse迁移到AndroidStudio

参考http://developer.android.com/sdk/installing/studio.html
Android Studio与Eclipse的不同点主要有
Gradle-based build support.
Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine as server-side components.
其中原生支持Google Cloud Platform貌似很有吸引力,可以很容易地把架在App Engine上的web端与Android端统一起来。

为了使用AndroidStudio,需要利用ADT从Eclipse中导出Gradle build files。按照官方文档中记载的步骤,
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.

此时工程根目录下会生成一个build.gradle文件和一个gradle文件夹,


继续执行以下步骤:

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 clickOK.
In the following dialog, leave Use gradle wrapper selected and clickOK. (You do not need to specify the Gradle home.)

这里有个问题要注意 在build.gradle文件中关于gradle版本的描述会直接导致import是否成功,由于现在gradle已经更新到2.21了,老版本有些类用不了,建议打开gradle文件修改

dependencies {
        classpath 'com.android.tools.build:gradle:1.0.+'
    }

如上改为1.0就可以了

导入的时候会直接下载gradle,但是天朝的关系很多都下载不了,稍后给出gradle文件

gradle2.2.1文件下载http://download.csdn.net/detail/chaoyue0071/8294471


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值