8

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.

Tawani
  • 11,067
  • 20
  • 82
  • 106
  • Can't try it from here, but can you do something like: right mouse, include path, configure include path, press the "source" tab, and add it? – Nanne Mar 16 '12 at 13:35
  • 6
    open the project location in your project folder you can see bin and gen folder delete it. come to eclipse and refresh it. – Padma Kumar Mar 16 '12 at 13:58
  • you might want to check out the link http://stackoverflow.com/questions/9532045/gen-already-exists-but-is-not-a-source-folder – MRSGT _GT Mar 16 '12 at 19:51

4 Answers4

32

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.

Kayhan Asghari
  • 2,817
  • 1
  • 28
  • 47
1
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.

Ranjit
  • 5,130
  • 3
  • 30
  • 66
1

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.

Patrick
  • 11,552
  • 7
  • 29
  • 41
0

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

Sanket Parchande
  • 894
  • 9
  • 14