如何导入Eclipse项目到Android的工作室呢? [英] How do you import an Eclipse project into Android Studio now?

查看:109
本文介绍了如何导入Eclipse项目到Android的工作室呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android的Studio中使用导入项目,用于改变项目结构和生成文件摇篮Eclipse项目,但现在(我用AS 0.5.3),它只是生成IDEA文件(.iml,.idea ),但不摇篮,它不是触摸文件结构两种。

Using "Import Project" in Android Studio for an Eclipse project used to change the project structure and generate Gradle files, but right now (I'm using AS 0.5.3) it's only generating IDEA files (.iml, .idea) but not Gradle and it's not touching the file structure either.

如何导入Eclipse项目到Android的Studio现在?

How do you import an Eclipse project into Android Studio now?

更新:尝试导出文件摇篮在Eclipse中不会导出他们的应用程序,它不会出现在Android的Studio中的一个模块,无论是

Update: Trying to export gradle files in Eclipse won't export them for the app, it doesn't show up as a module in Android Studio either.

推荐答案

在新版本的Andr​​oid工作室,引进一个Eclipse / ADT项目的最佳方法是直接将其导入到Android的工作室;我们曾经建议您从Eclipse中导出到摇篮第一,但我们一直没有更新ADT往往足以让与Android工作室的步伐。

In newer versions of Android Studio, the best way to bring in an Eclipse/ADT project is to import it directly into Android Studio; we used to recommend you export it from Eclipse to Gradle first, but we haven't been updating ADT often enough to keep pace with Android Studio.

在任何情况下,如果你从文件菜单或当你推出Android工作室的欢迎屏幕中选择导入项目,它应该带你通过一个专门的向导会提示你,它打算将文件复制到一个新的目录结构,而不是导入他们就地,它会提供给解决了一些常见的东西像将依赖关系Maven风格包括与这样的。

In any event, if you choose "Import Project" from the File menu or from the Welcome screen when you launch Android Studio, it should take you through a specialized wizard that will prompt you that it intends to copy the files into a new directory structure instead of importing them in-place, and it will offer to fix up some common things like converting dependencies into Maven-style includes and such.

这似乎并不像你得到这个专业的流程。我觉得它可能不会被识别导入的项目作为一个ADT的项目,它的默认为老内置于-的IntelliJ行为,不知道的摇篮。要获得专业进口工作时,必须满足以下条件:

It doesn't seem like you're getting this specialized flow. I think it may not be recognizing your imported project as an ADT project, and it's defaulting to the old built-into-IntelliJ behavior which doesn't know about Gradle. To get the specialized import working, the following must be true:

  • 在该项目的根目录下,你导入必须有一个的Andr​​oidManifest.xml 文件。
  • 或者:
    • 在根目录必须包含在的.project 的.classpath 从Eclipse的文件
    • The root directory of the project you import must have an AndroidManifest.xml file.
    • Either:
      • The root directory must contain the .project and .classpath files from Eclipse
      • 根directoy必须包含资源的src 目录。
      • The root directoy must contain res and src directories.

      如果您的项目是复杂的,也许你不指着它,因为它希望看到的导入成功的根目录。

      If your project is complex, perhaps you're not pointing it as the root directory it wants to see for the import to succeed.

      这篇关于如何导入Eclipse项目到Android的工作室呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆