开发者

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 a开发者_如何学Gofter 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.


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.


This is a file of generated code, you would normally only be commit sources to git.

You probably need to clean your project when you check it out, perhaps you've got some other object files mistakenly included in the commit so it looks like it's already been built.


It shouldn't be necessary to commit the "gen" directory to git as everything in it should be automatically generated based upon content elsewhere in your source. In fact, the "gen" directory may have been added to your .gitignore by the Android SDK.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜