Home » Android » Eclipse Android gen already exists but is not a source folder

Eclipse Android gen already exists but is not a source folder

Posted by: admin June 15, 2020 Leave a comment

Questions:

I am getting the following errors when I try to load an Android project in Eclipse that was working just fine last week.
Any ideas?

[2012-03-16 09:29:43 - MyProject] /MyProjectName/gen already exists but is not a source folder. Convert to a source folder or rename it

Note that I have tried to clean the project several times, even restarted but it still gives me this errors.

How to&Answers:

right click on project and go to project properties, then goto java build path, and then in source tab, click on add folder button and add gen folder.
just src and gen folders should be checked there if you haven’t any library projects attached.

Answer:

MyProject] /MyProjectName/gen already exists but is not a source folder. Convert to a source folder or rename it

This problem happens when eclipse does not able to find each linked contents in a project.

For example:

When we import a project to eclipse from a specific folder(suppose D://NewFolder), eclipse memorized and link each content with its appropriate path (which is D://NewFolder/project_library/src in our example).

But if we replaced(Here D://NewFolder To E://Another_Folder) or delete the library from its specific folder(Here D://NewFolder), eclipse unable to find its(project_library) original path
and give red error.

So when this problem happens, first we have to make sure that the imported project or library is its original folder and no changes has made to this.

Otherwise again replace the project to its specific folder to which eclipse has linked at the time of import i.e parent folder.

Answer:

This happens because your .classpath file got wiped out somehow. This file contains all the information from the Java Build Path tab under Project Properties. You could add in all information manually but there’s an easier way of fixing this problem.

If you have a copy of the .classpath file on your machine, you can just copy and paste it into your project directory.

Answer:

Follow these steps in Eclipse :
Project -> Properties -> Select Java Build Path ->
Open Source tab -> Click Add Folder and check the gen