Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Android gen already exists but is not a source folder

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.

like image 466
Tawani Avatar asked Mar 16 '12 13:03

Tawani


3 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.

like image 116
Keyhan Asghari Avatar answered Oct 06 '22 01:10

Keyhan Asghari


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.

like image 36
Ranjit Avatar answered Oct 05 '22 23:10

Ranjit


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.

like image 20
Patrick Avatar answered Oct 06 '22 01:10

Patrick