Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I manage an Android/Eclipse/Git project across multiple platforms?

I'm working on an Android group project, and have been running into issues with Eclipse's .metadata folder and git.

Originally, I didn't include the .metadata folder, which caused one teammate's eclipse workspace to completely break. The projects wouldn't show up in the package explorer, and the SDK couldn't be found. I am working under OSX and they're on Windows. So then I included the .metadata folder, and that fixed the problem with the projects not being found, but the commits are a nightmare! There are always thousands of insertions/deletions and the SDK is found, but it points to the wrong place.

Another issue is bin/ and gen/ files still show up as added/modified in Git. I know I'm missing something that is probably very obvious.

My .gitignore

# Trying to get bin/gen to not show up in Windows
AllTests/bin
AllTests/gen
Fire-Alert/bin
Fire-Alert/gen

# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/
target/
/bin
/gen

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

# Mac .DS_Store files
.DS_Store

File structure of my Eclipse workspace:

├── .git
│   ├── branches
│   ├── hooks
│   ├── info
│   ├── logs
│   ├── objects
│   └── refs
├── .metadata
│   └── .plugins
├── AllTests
│   ├── .settings
│   ├── assets
│   ├── bin
│   ├── gen
│   ├── res
│   └── src
└── Fire-Alert
    ├── .metadata
    ├── .settings
    ├── assets
    ├── bin
    ├── gen
    ├── libs
    ├── res
    └── src
like image 261
lcushman Avatar asked Mar 24 '26 00:03

lcushman


1 Answers

I don't have .metadata in my Android projects managed with Git and Eclipse. I don't think you need it.

As per bin/ and gen/ files showing up as added/modified in Git... It would seem they were inadvertently added to version control. You can remove them with:

git rm --cached bin/ gen/
git commit -m 'cleaning up bin/ and gen/'
like image 95
janos Avatar answered Mar 26 '26 15:03

janos