Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot commit android "gen" folder to Git

I am using EGit in eclipse to provide Git support for an Android project I am working on. The problem is that after committing my project to the local repository I realized that the "gen" folder was not getting committed. As a result of this when I try to open the project on another machine after getting the latest source from the Git repository I keep getting the following error:

ERROR: Unable to open class file D:\CodeRep\POCs\Java\Android\Sudoku\gen\org\blah\example\R.java: No such file or directory

Why can't I commit the "gen" folder to Git from Eclipse ? Everything gets committed just fine so I can push it to the remote repository.

like image 210
Cranialsurge Avatar asked Dec 06 '10 20:12

Cranialsurge


1 Answers

You shouldn't be commiting the gen folder; it contains generated code and doesn't belong in source control. You should be recreating it on the machine you pull the source code on with either an Eclipse "Project -> Clean" or a command line "ant clean" if you're using the build scripts.

like image 116
Yoni Samlan Avatar answered Oct 15 '22 05:10

Yoni Samlan