在Eclipse中导入现有的Android项目:没有gen源文件夹?

时间:2023-01-18 23:12:03

I'm trying to import an android project into Eclipse (from Git, but I don't think it's relevant), and I can't run or compile it because I get these errors:

我正在尝试将一个android项目导入Eclipse(来自Git,但我不认为它是相关的),我无法运行或编译它因为我得到这些错误:

Android requires compiler compliance level 5.0. Please fix project properties.  Serval-Video-Discovery      line 1  Android ADT Problem 
Project 'Serval-Video-Discovery' is missing required source folder: 'gen'   Serval-Video-Discovery      Build path  Build Path Problem

I think the first one isn't really a big problem, even if I don't really understand the warning.

我认为第一个并不是一个大问题,即使我不太了解这个警告。

The funny thing is that the "gen" folder exists on the filesystem; furthermore, I can't try to create it because it already exists !

有趣的是文件系统中存在“gen”文件夹;此外,我不能尝试创建它,因为它已经存在!

What should I do to solve this issue?

我该怎么做才能解决这个问题?

Here is the GitHub repo I'm trying to import from: https://github.com/rbochet/Serval-Video-Discovery

这是我试图导入的GitHub仓库:https://github.com/rbochet/Serval-Video-Discovery

5 个解决方案

#1


31  

Package Explorer -> Right click the project -> "Android Tools" -> "Fix Project Properties"
Project -> Clean

Fixes without having to restart eclipse

无需重启eclipse即可修复

#2


13  

Android requires compiler compliance level 5.0. Please fix project properties.

I had the same problem but non of these answers helped me. I found my solution here:

我有同样的问题,但没有这些答案帮助了我。我在这里找到了解决方案:

Package Explorer -> Right click the project -> "Android Tools" -> "Fix Project Properties"

包资源管理器 - >右键单击项目 - >“Android工具” - >“修复项目属性”

#3


1  

I had the same problem but solved in the following way

我有同样的问题,但通过以下方式解决

Package Explorer -> Right click the project -> Properties -> Java Build Path -> Source -> your project name/gen -> click on Remove -> Click on Add Folder -> check gen -> Ok -> Ok    

#4


0  

Just right click and delete the gen directory from eclipse. If not, try the fix project properties above.

只需右键单击并从eclipse中删除gen目录。如果没有,请尝试上面的修复项目属性。

#5


0  

If gen folder is missing under project after importing an existing project into workplace, just create a gen folder under project and that will fix the above error.

如果在将现有项目导入工作区后项目下缺少gen文件夹,只需在项目下创建一个gen文件夹即可修复上述错误。

#1


31  

Package Explorer -> Right click the project -> "Android Tools" -> "Fix Project Properties"
Project -> Clean

Fixes without having to restart eclipse

无需重启eclipse即可修复

#2


13  

Android requires compiler compliance level 5.0. Please fix project properties.

I had the same problem but non of these answers helped me. I found my solution here:

我有同样的问题,但没有这些答案帮助了我。我在这里找到了解决方案:

Package Explorer -> Right click the project -> "Android Tools" -> "Fix Project Properties"

包资源管理器 - >右键单击项目 - >“Android工具” - >“修复项目属性”

#3


1  

I had the same problem but solved in the following way

我有同样的问题,但通过以下方式解决

Package Explorer -> Right click the project -> Properties -> Java Build Path -> Source -> your project name/gen -> click on Remove -> Click on Add Folder -> check gen -> Ok -> Ok    

#4


0  

Just right click and delete the gen directory from eclipse. If not, try the fix project properties above.

只需右键单击并从eclipse中删除gen目录。如果没有,请尝试上面的修复项目属性。

#5


0  

If gen folder is missing under project after importing an existing project into workplace, just create a gen folder under project and that will fix the above error.

如果在将现有项目导入工作区后项目下缺少gen文件夹,只需在项目下创建一个gen文件夹即可修复上述错误。