Android Studio导入项目
一、导入Android Studio项目
操作步骤:File --> New --> Import Project,弹出对话框,选择要导入的Studio项目
二、导入Eclipse项目
1. File --> New --> Import Project,弹出对话框,选择要导入的Eclipse项目
1. 一个工程,直接导入就可以了
2. 如果有多个依赖工程,需要导入主工程
2. 指定存放路径:(原来的Eclipse项目不变,会生成新的Studio项目)
3. 点击下一步,会弹出转换配置对话框
在导入ADT项目时,Android Studio能识别出jar文件和整个库的资源拷贝文件,并且可以把这些文件替换为Gradle依赖
Replace jars with dependencies , when possible:在可能的情况下,使用依赖替换jars
Replace library sources with dependencies , when possible:在可能的情况下,使用依赖替换库资源
Create Gradle - style (camelCase) module names:创建Gradle风格(驼峰式)的模块名
4. 导入摘要
|
ECLIPSE ANDROID PROJECT IMPORT SUMMARY(Eclipse Android 项目导入摘要) ====================================== Ignored Files:(忽略文件) -------------- The following files were *not* copied into the new Gradle project; you should evaluate whether these are still needed in your project and if so manually move them: //翻译:下面的文件没有被复制到新的Gradle项目;如果你的项目中仍然需要用到它们,请手动复制过来。 * ic_launcher-web.png * proguard-project.txt Moved Files:(移动文件) ------------ Android Gradle projects use a different directory structure than ADT Eclipse projects. Here's how the projects were restructured: //翻译:Android Gradle项目与ADT Eclipse项目使用不同的目录结构,项目是这样被重组的。 * AndroidManifest.xml => app\src\main\AndroidManifest.xml * assets\ => app\src\main\assets * res\ => app\src\main\res\ * src\ => app\src\main\java\ Next Steps:(下一步) ----------- You can now build the project. The Gradle project needs network connectivity to download dependencies. //翻译:你现在可以构建项目了,Gradle项目需要连网来下载依赖。 Bugs: ----- If for some reason your project does not build, and you determine that it is due to a bug or limitation of the Eclipse to Gradle importer, please file a bug at http://b.android.com with category Component-Tools. //翻译:如果你确认因为Gradle导入Eclipse项目导致你的项目无法构建,请提Bug到:http://b.android.com 的Component-Tools. (This import summary is for your information only, and can be deleted after import once you are satisfied with the results.) //翻译:import - summary.txt文件仅是一些导入信息,你可以删除。 |
5. 解决错误
在Studio的Message工具窗口中会有相关的错误信息提示,如下(下载对应的SDK版本)