简体   繁体   English

Eclipse导入项目不正确

[英]Eclipse Imports Project Incorrectly

I am attempting to import a project that is originally a Git repo. 我正在尝试导入最初是Git存储库的项目。 I ran the git clone command to pull down the code into the workspace. 我运行git clone命令将代码下拉到工作区中。 Now when I right click->import existing android project and import the project eclipse imports it without displaying any errors. 现在,当我右键单击->导入现有的android项目并导入eclipse时,导入项目时不会显示任何错误。 However when it imports it all of the classes are moved to a classes directory (as opposed to src) and there are no packages in src. 但是,在导入时,所有类都移到了类目录(与src相反),并且src中没有包。 When I go in the classes directory and select a class it opens the Class File Editor and reads "Source not found". 当我进入classes目录并选择一个类时,它将打开“类文件编辑器”并显示“找不到源”。

Some extra detail : The classes directory is compiled java bytecode. 一些额外的细节 :classes目录是编译的Java字节码。 However if I navigate into my workspace manually and open the .java file with a text editor the source code is directly there. 但是,如果我手动导航到工作区并使用文本编辑器打开.java文件,则源代码就直接在其中。 In fact the classes directory does not exist, everything is organized as normal in the workspace. 实际上,classes目录不存在,所有内容在工作空间中均按常规组织。 But its eclipse that compiles and creates the classes directory on import. 但是在导入时会编译并创建classes目录的日食

I have searched SO and couldn't find anything similar, though I feel like someone would have run into this before. 我已经搜索过SO,但是找不到任何类似的东西,尽管我觉得以前有人会遇到这个问题。

How can I correctly import the project? 如何正确导入项目?

Thanks 谢谢

Instead of using import existing android project, use the import 'existing projects into workspace' option. 而不是使用导入现有的android项目,而是使用导入“将现有项目导入工作区”选项。 Use the general import that doesn't say "android", in other words. 换句话说,请使用不显示“ android”的常规导入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM