Android Studio导入项目

来源:互联网 发布:在淘宝上怎样分期付款 编辑:程序博客网 时间:2024/04/30 01:07

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; youshould evaluate whether these are still needed in your project and ifso manually move them://翻译:下面的文件没有被复制到新的Gradle项目;如果你的项目中仍然需要用到它们,请手动复制过来。* ic_launcher-web.png* proguard-project.txtMoved Files:(移动文件)------------Android Gradle projects use a different directory structure than ADTEclipse 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 networkconnectivity to download dependencies.//翻译:你现在可以构建项目了,Gradle项目需要连网来下载依赖。Bugs:-----If for some reason your project does not build, and you determine thatit is due to a bug or limitation of the Eclipse to Gradle importer,please file a bug at http://b.android.com with categoryComponent-Tools.//翻译:如果你确认因为Gradle导入Eclipse项目导致你的项目无法构建,请提Bug到:http://b.android.com 的Component-Tools.(This import summary is for your information only, and can be deletedafter import once you are satisfied with the results.)//翻译:import - summary.txt文件仅是一些导入信息,你可以删除。

 

5. 解决错误

StudioMessage工具窗口中会有相关的错误信息提示,如下(下载对应的SDK版本)


原创粉丝点击