Eclipse Android and gitignore

What files/folders can I safely ignore for inclusion with git?

I copied a good project, removed its gen and bin folders and tried to run the app. The Android Launch window says, "Your project contains error(s), please fix them before running your application. There is a red X on the icon to the left of the project in the Package Explorer. While the gen folder does not exist in Windows Explorer, it does in Package Explorer.


Solution 1:

There are file types to ignore

# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties

# Eclipse project files
.classpath
.project

# Proguard folder generated by Eclipse
proguard/

# Intellij project files
*.iml
*.ipr
*.iws
.idea/

From Gitignore on github

Solution 2:

What I usually add to .gitignore is:

bin
gen

bin and gen are constantly changed while coding, so there's no need to include them into the Git repository. Also, sometimes I add .classpath and .project which are Eclipse specific files, because maybe I want to create a new Android project based on these same sources, but in another OS or IDE.

With regards to the error, I would clean the project and/or try to run the Fix Project Properties utility (right-click on the Project -> Android Tools -> Fix Project Properties).