Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Android and gitignore

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


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


Best solution today is probably to generate the exact .gitignore file you need. Just go to http://www.gitignore.io

The project is also on Github: https://github.com/joeblau/gitignore.io


It's safe to ignore bin and gen, without problems. When I have problems with a project setup, I do this: First - have you looked at the 'Problems' tab in the view underneath the editor view - it generally gives more detailed information about project errors. If there's nothing conclusive there, I do the things below:

  1. Generally, when I'm having issues with Eclipse giving me phantom errors in the project, cleaning the project will fix it. It's in the menu, under Project>Clean.
  2. If that doesn't work, I'll usually try right clicking the project, going to Android Tools> Fix project properties.
  3. My last resort it to restart eclipse and delete the gen folder.